/* ============================================================
   MyAISandbox — Workspace IDE Stylesheet (v2 Redesign)
   Slim sidebar, floating chat, maximum editor space
   ============================================================ */

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Backgrounds */
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-hover: #1a1a2e;
  --surface-active: #22223a;
  --border: #2a2a3e;
  --border-light: #333350;

  /* Brand */
  --primary: #00d4aa;
  --primary-hover: #00f0c0;
  --primary-glow: rgba(0, 212, 170, 0.15);
  --secondary: #7c5cff;
  --secondary-hover: #9478ff;
  --accent: #f0c040;

  /* Text */
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --text-dim: #555570;

  /* Semantic */
  --success: #00d4aa;
  --warning: #f0c040;
  --error: #ff4060;
  --info: #4488ff;

  /* Code */
  --code-bg: #0d0d14;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-fast: 0.15s ease;

  /* Layout */
  --topbar-height: 40px;
  --activity-bar-width: 44px;
  --statusbar-height: 22px;
  --sidebar-width: 220px;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  outline: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  color: inherit;
  outline: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-sm) 0 var(--space-md);
  gap: var(--space-sm);
  z-index: 100;
  user-select: none;
  flex-shrink: 0;
}

.topbar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}
.topbar-logo .logo-svg {
  width: 20px;
  height: 20px;
  stroke: var(--primary);
}

.topbar-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}

/* Project dropdown trigger */
.topbar-project-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.topbar-project-btn:hover {
  background: var(--surface-hover);
}
.topbar-project-btn svg {
  color: var(--text-dim);
  transition: transform var(--transition-fast);
}
.topbar-project-btn.open svg {
  transform: rotate(180deg);
}

/* Nav tabs */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: var(--space-sm);
}
.topbar-nav-btn {
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  transition: all var(--transition-fast);
}
.topbar-nav-btn:hover {
  color: var(--text-muted);
  background: var(--surface-hover);
}
.topbar-nav-btn.active {
  color: var(--text);
  background: var(--surface-hover);
}

.topbar-spacer {
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.topbar-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
}
.topbar-btn:hover {
  background: var(--surface-hover);
}
.topbar-btn .btn-label {
  font-size: 12px;
}

.topbar-btn-run {
  background: rgba(0, 212, 170, 0.1);
  color: var(--primary);
}
.topbar-btn-run:hover {
  background: rgba(0, 212, 170, 0.2);
}

.topbar-btn-deploy {
  color: var(--text-dim);
}
.topbar-btn-deploy:hover {
  color: var(--text-muted);
  background: var(--surface-hover);
}

.badge-pro {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--secondary), #a78bfa);
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.3;
}

.topbar-user {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition);
}
.topbar-user svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}
.topbar-user:hover {
  border-color: var(--primary);
}

/* ============================================================
   PROJECT DROPDOWN OVERLAY
   ============================================================ */
.project-overlay {
  display: none;
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.4);
}
.project-overlay.open {
  display: block;
}

.project-overlay-content {
  position: absolute;
  top: 0;
  left: 80px;
  width: 300px;
  max-height: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.project-overlay-search {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
}
.project-overlay-search svg {
  color: var(--text-dim);
  flex-shrink: 0;
}
.project-search-input {
  flex: 1;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text);
  background: transparent;
}
.project-search-input::placeholder {
  color: var(--text-dim);
}

.project-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xs) 0;
}

.project-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px var(--space-md);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.project-list-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.project-list-item.active {
  color: var(--primary);
}
.project-list-item svg {
  flex-shrink: 0;
}

.project-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-left: auto;
}

.project-new-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--primary);
  width: 100%;
  transition: background var(--transition-fast);
}
.project-new-btn:hover {
  background: var(--primary-glow);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.workspace-layout {
  display: flex;
  height: calc(100vh - var(--topbar-height) - var(--statusbar-height));
  overflow: hidden;
}

/* ============================================================
   ACTIVITY BAR (leftmost icon strip)
   ============================================================ */
.activity-bar {
  width: var(--activity-bar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-xs) 0;
  flex-shrink: 0;
  z-index: 10;
}

.activity-bar-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.activity-bar-bottom {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  position: relative;
  transition: all var(--transition);
}
.activity-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.activity-btn.active {
  color: var(--text);
}
.activity-btn.active::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--primary);
  border-radius: 1px;
}

.activity-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  transition: width var(--transition), opacity var(--transition);
}
.sidebar.collapsed {
  width: 0;
  opacity: 0;
  overflow: hidden;
  border-right: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px var(--space-sm) 6px var(--space-md);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  height: 32px;
}
.sidebar-header h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}
.sidebar-header-actions {
  display: flex;
  gap: 2px;
}
.sidebar-header-btn {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--text-dim);
  transition: all var(--transition-fast);
}
.sidebar-header-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* Sidebar panel content */
.sidebar-panel-content {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.sidebar-panel-content.visible {
  display: flex;
}

/* File Tree */
.file-tree {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-xs) 0;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--space-sm);
  padding-left: calc(var(--space-sm) + var(--depth, 0) * 14px);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  user-select: none;
  white-space: nowrap;
  height: 24px;
}
.tree-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.tree-item.active {
  background: var(--surface-active);
  color: var(--text);
}

.tree-icon {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
}

.tree-chevron {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 9px;
  transition: transform var(--transition-fast);
}
.tree-chevron.open {
  transform: rotate(90deg);
}

.tree-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Search Panel */
.search-panel .search-input-wrap {
  padding: var(--space-sm);
  flex-shrink: 0;
}
.search-input {
  width: 100%;
  padding: 5px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
}
.search-input::placeholder {
  color: var(--text-dim);
}
.search-input:focus {
  border-color: var(--primary);
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xs) var(--space-sm);
}

/* Panel placeholders */
.panel-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  padding: var(--space-xl) var(--space-md);
}

/* Modules and Settings panels */
.modules-panel,
.settings-panel {
  flex: 1;
  padding: var(--space-sm);
  overflow-y: auto;
}

/* File icons by extension */
.file-icon-html { color: #e44d26; }
.file-icon-css { color: #264de4; }
.file-icon-js { color: #f0db4f; }
.file-icon-md { color: #519aba; }
.file-icon-json { color: #cbcb41; }
.file-icon-folder { color: var(--accent); }
.file-icon-folder-open { color: var(--accent); }

/* ============================================================
   CENTER AREA (Editor + Bottom Panel)
   ============================================================ */
.center-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 200px;
  background: var(--bg);
  flex: 1;
}

/* ---- Editor Tabs ---- */
.editor-tabs {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 32px;
  overflow-x: auto;
  flex-shrink: 0;
  user-select: none;
}
.editor-tabs::-webkit-scrollbar {
  height: 0;
}

.editor-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  height: 100%;
  font-size: 12px;
  color: var(--text-dim);
  border-right: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}
.editor-tab:hover {
  color: var(--text-muted);
  background: var(--surface-hover);
}
.editor-tab.active {
  color: var(--text);
  background: var(--bg);
}
.editor-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--bg);
}
.editor-tab .tab-icon {
  font-size: 12px;
  flex-shrink: 0;
}
.editor-tab .tab-close {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-size: 14px;
  color: var(--text-dim);
  opacity: 0;
  transition: all var(--transition-fast);
}
.editor-tab:hover .tab-close,
.editor-tab.active .tab-close {
  opacity: 1;
}
.editor-tab .tab-close:hover {
  background: rgba(255, 64, 96, 0.2);
  color: var(--error);
}

.editor-tab .tab-modified {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  display: none;
}
.editor-tab.modified .tab-modified {
  display: block;
}
.editor-tab.modified .tab-close {
  display: none;
}
.editor-tab.modified:hover .tab-modified {
  display: none;
}
.editor-tab.modified:hover .tab-close {
  display: flex;
}

/* ---- Editor Container ---- */
.editor-pane {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#editor-container {
  width: 100%;
  height: 100%;
}

.editor-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
  gap: var(--space-md);
  padding: var(--space-xl);
  text-align: center;
}
.editor-welcome h2 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
}
.editor-welcome p {
  font-size: 12px;
  max-width: 280px;
}

/* ---- Bottom Panel ---- */
.bottom-panel {
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 36px;
  background: var(--surface);
}
.bottom-panel.collapsed {
  min-height: 32px;
  max-height: 32px;
}
.bottom-panel.collapsed .bottom-content {
  display: none;
}
.bottom-panel.collapsed #btn-toggle-bottom svg {
  transform: rotate(180deg);
}

.bottom-tabs {
  display: flex;
  align-items: center;
  height: 28px;
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-xs);
  flex-shrink: 0;
  user-select: none;
  gap: 1px;
}

.bottom-tab-group {
  display: flex;
  gap: 1px;
}

.bottom-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.bottom-tab svg {
  flex-shrink: 0;
}
.bottom-tab span {
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.bottom-tab:hover {
  color: var(--text-muted);
}
.bottom-tab.active {
  color: var(--text);
  background: var(--surface-hover);
}

.bottom-tab-actions {
  margin-left: auto;
  display: flex;
  gap: 2px;
}
.bottom-tab-action-btn {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--text-dim);
  transition: all var(--transition-fast);
}
.bottom-tab-action-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.bottom-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.bottom-pane {
  display: none;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.bottom-pane.active {
  display: block;
}

/* Preview */
.preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

/* Terminal */
#terminal-container {
  width: 100%;
  height: 100%;
  padding: var(--space-xs);
}
#terminal-container .xterm {
  height: 100%;
}

/* Console */
.console-output {
  padding: var(--space-xs) var(--space-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-y: auto;
  height: 100%;
}
.console-line {
  padding: 1px 0;
  display: flex;
  gap: var(--space-sm);
}
.console-line .console-timestamp {
  color: var(--text-dim);
  flex-shrink: 0;
}
.console-line .console-msg {
  color: var(--text-muted);
}
.console-line.log .console-msg { color: var(--text); }
.console-line.warn .console-msg { color: var(--warning); }
.console-line.error .console-msg { color: var(--error); }
.console-line.info .console-msg { color: var(--info); }

/* ============================================================
   FLOATING CHAT WINDOW
   ============================================================ */
.chat-float {
  position: fixed;
  bottom: 60px;
  right: 20px;
  width: 380px;
  height: 480px;
  min-width: 300px;
  min-height: 300px;
  max-width: 600px;
  max-height: 80vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 1px rgba(0, 212, 170, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 500;
  overflow: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.chat-float.hidden {
  display: none;
}

/* Titlebar (draggable) */
.chat-float-titlebar {
  display: flex;
  align-items: center;
  height: 34px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  flex-shrink: 0;
  user-select: none;
  padding-right: var(--space-xs);
}
.chat-float-titlebar:active {
  cursor: grabbing;
}

.chat-float-tabs {
  display: flex;
  flex: 1;
  height: 100%;
}
.chat-float-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.chat-float-tab:hover {
  color: var(--text-muted);
  background: var(--surface-hover);
}
.chat-float-tab.active {
  color: var(--text);
  border-bottom-color: var(--primary);
}

.chat-float-controls {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.chat-float-control {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--text-dim);
  transition: all var(--transition-fast);
}
.chat-float-control:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* Model selector */
.chat-model-selector {
  display: flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.model-select {
  width: 100%;
  padding: 3px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23555570'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 22px;
}
.model-select:focus {
  border-color: var(--primary);
}
.model-select option {
  background: var(--surface);
  color: var(--text);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.chat-message {
  display: flex;
  gap: var(--space-sm);
  max-width: 92%;
  animation: msgIn 0.2s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message.ai { align-self: flex-start; }
.chat-message.user { align-self: flex-end; flex-direction: row-reverse; }

.chat-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.chat-message.ai .chat-avatar { background: var(--primary-glow); }
.chat-message.user .chat-avatar { background: var(--surface-hover); }

.chat-bubble {
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}
.chat-message.ai .chat-bubble {
  background: var(--surface-hover);
  color: var(--text);
  border-top-left-radius: var(--radius-xs);
}
.chat-message.user .chat-bubble {
  background: rgba(0, 212, 170, 0.12);
  color: var(--text);
  border-top-right-radius: var(--radius-xs);
}
.chat-bubble code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Chat Input */
.chat-input-area {
  padding: var(--space-xs) var(--space-sm);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: var(--space-xs);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  transition: border-color var(--transition);
}
.chat-input-wrap:focus-within {
  border-color: var(--primary);
}
.chat-input {
  flex: 1;
  min-height: 32px;
  max-height: 100px;
  padding: 5px 8px;
  font-size: 12px;
  resize: none;
  line-height: 1.5;
  color: var(--text);
  background: transparent;
}
.chat-input::placeholder {
  color: var(--text-dim);
}

.chat-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.chat-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.chat-btn-send {
  color: var(--primary);
}
.chat-btn-send:hover {
  background: var(--primary-glow);
}

/* Resize handle */
.chat-float-resize {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  cursor: nw-resize;
  z-index: 10;
}

/* ============================================================
   GENIE TOGGLE BUTTON
   ============================================================ */
.genie-toggle {
  position: fixed;
  bottom: 32px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.3);
  z-index: 501;
  transition: transform var(--transition), box-shadow var(--transition);
  border: none;
  cursor: pointer;
}
.genie-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0, 212, 170, 0.4);
}
.genie-toggle.hidden {
  display: none;
}
.genie-icon {
  line-height: 1;
}

/* ============================================================
   STATUS BAR
   ============================================================ */
.statusbar {
  display: flex;
  align-items: center;
  height: var(--statusbar-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0 var(--space-sm);
  font-size: 11px;
  color: var(--text-dim);
  user-select: none;
  gap: var(--space-md);
  z-index: 100;
  flex-shrink: 0;
}

.statusbar-left,
.statusbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.statusbar-left { flex: 1; }
.statusbar-right { flex-shrink: 0; }

.status-item {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: default;
}
.status-item:hover {
  color: var(--text-muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.status-dot.connected { background: var(--success); }
.status-dot.disconnected { background: var(--error); }

/* ============================================================
   SPLIT.JS GUTTERS
   ============================================================ */
.gutter {
  background: var(--border);
  transition: background var(--transition);
  z-index: 5;
}
.gutter:hover {
  background: var(--primary);
}
.gutter.gutter-horizontal {
  cursor: col-resize;
  width: 3px !important;
}
.gutter.gutter-vertical {
  cursor: row-resize;
  height: 3px !important;
}

/* ============================================================
   UTILITY
   ============================================================ */
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar-nav { display: none; }
  .chat-float {
    width: 300px;
    height: 400px;
    right: 10px;
    bottom: 50px;
  }
}
@media (max-width: 600px) {
  .activity-bar { width: 38px; }
  .activity-btn { width: 30px; height: 30px; }
  .topbar-btn .btn-label { display: none; }
  .chat-float {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 50px;
  }
}
