/* ============================================
   Nexus IDE — Layout
   IDE 整体布局：topbar / activitybar / sidebar /
   editor-area / aichat / statusbar 的 CSS Grid
   ============================================ */

:root {
  --ide-topbar-h: 44px;
  --ide-statusbar-h: 26px;
  --ide-activitybar-w: 52px;
  --ide-sidebar-w: 260px;
  --ide-aichat-w: 360px;
  --ide-terminal-h: 220px;
  --ide-sidebar-collapsed-w: 0px;
  --ide-aichat-collapsed-w: 0px;

  /* IDE 专用调色板（在 tokens 之外再覆盖一层） */
  --ide-bg-base: #0b0b10;
  --ide-bg-elevated: #13131c;
  --ide-bg-soft: #181822;
  --ide-border: rgba(255, 255, 255, 0.07);
  --ide-border-strong: rgba(255, 255, 255, 0.14);
  --ide-text-primary: #f5f5fa;
  --ide-text-secondary: rgba(245, 245, 250, 0.7);
  --ide-text-tertiary: rgba(245, 245, 250, 0.45);
  --ide-text-muted: rgba(245, 245, 250, 0.3);
  --ide-accent: var(--color-accent-primary, #a78bfa);
  --ide-accent-soft: rgba(167, 139, 250, 0.14);
  --ide-accent-border: rgba(167, 139, 250, 0.32);
  --ide-success: #34d399;
  --ide-warning: #fbbf24;
  --ide-danger: #f87171;
}

[data-theme="light"] {
  --ide-bg-base: #ffffff;
  --ide-bg-elevated: #f7f7fa;
  --ide-bg-soft: #eeeef3;
  --ide-border: rgba(0, 0, 0, 0.08);
  --ide-border-strong: rgba(0, 0, 0, 0.16);
  --ide-text-primary: #0c0c14;
  --ide-text-secondary: rgba(12, 12, 20, 0.7);
  --ide-text-tertiary: rgba(12, 12, 20, 0.5);
  --ide-text-muted: rgba(12, 12, 20, 0.3);
  --ide-accent: #7c3aed;
  --ide-accent-soft: rgba(124, 58, 237, 0.1);
  --ide-accent-border: rgba(124, 58, 237, 0.3);
}

/* === 强调色覆写（由 JS 设置 [data-accent]） === */
[data-accent="violet"]  { --ide-accent: #a78bfa; --ide-accent-soft: rgba(167, 139, 250, .14); --ide-accent-border: rgba(167, 139, 250, .32); }
[data-accent="cyan"]    { --ide-accent: #22d3ee; --ide-accent-soft: rgba(34, 211, 238, .14); --ide-accent-border: rgba(34, 211, 238, .32); }
[data-accent="emerald"] { --ide-accent: #34d399; --ide-accent-soft: rgba(52, 211, 153, .14); --ide-accent-border: rgba(52, 211, 153, .32); }
[data-accent="rose"]    { --ide-accent: #fb7185; --ide-accent-soft: rgba(251, 113, 133, .14); --ide-accent-border: rgba(251, 113, 133, .32); }
[data-accent="amber"]   { --ide-accent: #fbbf24; --ide-accent-soft: rgba(251, 191, 36, .14); --ide-accent-border: rgba(251, 191, 36, .32); }
[data-accent="blue"]    { --ide-accent: #60a5fa; --ide-accent-soft: rgba(96, 165, 250, .14); --ide-accent-border: rgba(96, 165, 250, .32); }

/* ============================================
   IDE 根容器
   ============================================ */
.ide {
  display: grid;
  height: 100vh;
  width: 100vw;
  grid-template-columns: var(--ide-activitybar-w) var(--ide-sidebar-w) 1fr var(--ide-aichat-w);
  grid-template-rows: var(--ide-topbar-h) 1fr var(--ide-statusbar-h);
  grid-template-areas:
    "topbar topbar topbar topbar"
    "activity sidebar editor aichat"
    "status status status status";
  background: var(--ide-bg-base);
  color: var(--ide-text-primary);
  overflow: hidden;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 13px;
}

.ide.is-sidebar-collapsed {
  grid-template-columns: var(--ide-activitybar-w) 0 1fr var(--ide-aichat-w);
}
.ide.is-aichat-collapsed {
  grid-template-columns: var(--ide-activitybar-w) var(--ide-sidebar-w) 1fr 0;
}
.ide.is-sidebar-collapsed.is-aichat-collapsed {
  grid-template-columns: var(--ide-activitybar-w) 0 1fr 0;
}

/* ============================================
   Top Bar
   ============================================ */
.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  height: var(--ide-topbar-h);
  padding: 0 10px;
  background: var(--ide-bg-elevated);
  border-bottom: 1px solid var(--ide-border);
  gap: 10px;
  z-index: 5;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-logo {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--ide-accent), #22d3ee);
  color: #08080c;
  font-weight: 800;
  font-size: 14px;
  font-family: var(--font-display, system-ui);
  flex-shrink: 0;
}

.topbar-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ide-text-primary);
}

.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.topbar-btn-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(520px, 100%);
  height: 30px;
  padding: 0 10px 0 12px;
  background: var(--ide-bg-soft);
  border: 1px solid var(--ide-border);
  border-radius: 8px;
  color: var(--ide-text-tertiary);
  font-size: 12px;
  transition: all 150ms ease;
  cursor: pointer;
  text-align: left;
}
.topbar-btn-primary:hover {
  background: var(--ide-bg-elevated);
  border-color: var(--ide-border-strong);
  color: var(--ide-text-secondary);
}
.topbar-btn-primary svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--ide-text-tertiary);
}
.topbar-btn-primary span:first-of-type {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-btn-primary .kbd {
  padding: 1px 6px;
  background: var(--ide-bg-base);
  border: 1px solid var(--ide-border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ide-text-tertiary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--ide-text-secondary);
  transition: all 150ms ease;
  cursor: pointer;
  position: relative;
}
.topbar-btn:hover {
  background: var(--ide-bg-soft);
  color: var(--ide-text-primary);
}
.topbar-btn svg {
  width: 16px;
  height: 16px;
}
.topbar-btn.is-active {
  color: var(--ide-accent);
  background: var(--ide-accent-soft);
}

.topbar-divider {
  width: 1px;
  height: 18px;
  background: var(--ide-border);
  margin: 0 4px;
}

.topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ide-accent), #22d3ee);
  color: #08080c;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: transform 150ms ease;
}
.topbar-avatar:hover {
  transform: scale(1.05);
}

/* ============================================
   Activity Bar
   ============================================ */
.activitybar {
  grid-area: activity;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--ide-bg-elevated);
  border-right: 1px solid var(--ide-border);
  padding: 6px 0;
  gap: 2px;
  z-index: 4;
}

.activitybar-icon {
  width: 40px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ide-text-tertiary);
  transition: all 150ms ease;
  cursor: pointer;
  position: relative;
}
.activitybar-icon:hover {
  color: var(--ide-text-primary);
  background: var(--ide-bg-soft);
}
.activitybar-icon.is-active {
  color: var(--ide-text-primary);
  background: var(--ide-accent-soft);
}
.activitybar-icon.is-active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--ide-accent);
  border-radius: 0 2px 2px 0;
}
.activitybar-icon svg {
  width: 20px;
  height: 20px;
}

.activitybar-spacer {
  flex: 1;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--ide-bg-elevated);
  border-right: 1px solid var(--ide-border);
}

.ide.is-sidebar-collapsed .sidebar {
  border-right: none;
}
.sidebar.is-collapsed { display: none; }
.aichat.is-collapsed { display: none; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--ide-border);
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ide-text-secondary);
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 1px;
}

.sidebar-icon-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--ide-text-tertiary);
  transition: all 150ms ease;
  cursor: pointer;
}
.sidebar-icon-btn:hover {
  background: var(--ide-bg-soft);
  color: var(--ide-text-primary);
}
.sidebar-icon-btn svg {
  width: 14px;
  height: 14px;
}

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 10px;
  padding: 0 8px;
  height: 30px;
  background: var(--ide-bg-soft);
  border: 1px solid var(--ide-border);
  border-radius: 6px;
}
.sidebar-search svg {
  width: 12px;
  height: 12px;
  color: var(--ide-text-tertiary);
  flex-shrink: 0;
}
.sidebar-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 12px;
  color: var(--ide-text-primary);
}
.sidebar-search input::placeholder {
  color: var(--ide-text-muted);
}
.sidebar-search:focus-within {
  border-color: var(--ide-accent-border);
}

.sidebar-tree {
  flex: 1;
  overflow: auto;
  padding: 4px 0 12px;
  font-size: 13px;
}

.sidebar-padded {
  padding: 12px;
  font-size: 12px;
  color: var(--ide-text-secondary);
}

/* ============================================
   Editor Area
   ============================================ */
.editor-area {
  grid-area: editor;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--ide-bg-base);
  position: relative;
  overflow: hidden;
}

/* Tab Bar */
.tabbar {
  display: flex;
  align-items: stretch;
  height: 36px;
  background: var(--ide-bg-elevated);
  border-bottom: 1px solid var(--ide-border);
  flex-shrink: 0;
  min-width: 0;
}

.tabs {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.tabs::-webkit-scrollbar { height: 3px; }
.tabs::-webkit-scrollbar-thumb { background: var(--ide-border-strong); border-radius: 3px; }

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 10px 0 12px;
  border-right: 1px solid var(--ide-border);
  font-size: 12px;
  color: var(--ide-text-secondary);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 200px;
  background: transparent;
  transition: background 120ms ease;
}
.tab:hover {
  background: var(--ide-bg-soft);
  color: var(--ide-text-primary);
}
.tab.is-active {
  background: var(--ide-bg-base);
  color: var(--ide-text-primary);
}
.tab.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ide-accent);
}
.tab-icon {
  font-size: 13px;
  line-height: 1;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}
.tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.tab-close {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  font-size: 14px;
  color: var(--ide-text-tertiary);
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  background: transparent;
  border: none;
  transition: all 120ms ease;
}
.tab-close:hover {
  background: var(--ide-border-strong);
  color: var(--ide-text-primary);
}
.tab.is-modified .tab-close {
  color: var(--ide-text-secondary);
}
.tab-dirty {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ide-accent);
  display: inline-block;
}

.tab-actions {
  display: flex;
  align-items: center;
  padding: 0 6px;
  border-left: 1px solid var(--ide-border);
  flex-shrink: 0;
  gap: 2px;
}
.tab-action {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--ide-text-tertiary);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all 120ms ease;
}
.tab-action:hover {
  background: var(--ide-bg-soft);
  color: var(--ide-text-primary);
}
.tab-action svg {
  width: 14px;
  height: 14px;
}

/* Editor Container */
.editor-container {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--ide-bg-base);
}

#monaco-editor {
  width: 100% !important;
  height: 100% !important;
}

.editor-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  color: var(--ide-text-secondary);
  padding: 20px;
}
.editor-empty-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--ide-accent), #22d3ee);
  color: #08080c;
  font-weight: 800;
  font-size: 26px;
  font-family: var(--font-display, system-ui);
  margin-bottom: 6px;
  box-shadow: 0 8px 32px rgba(167, 139, 250, 0.3);
}
.editor-empty h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ide-text-primary);
  margin: 0;
}
.editor-empty p {
  font-size: 13px;
  color: var(--ide-text-tertiary);
  margin: 0 0 12px;
}
.editor-empty-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ============================================
   Terminal Panel
   ============================================ */
.terminal-panel {
  flex-shrink: 0;
  height: var(--ide-terminal-h);
  display: flex;
  flex-direction: column;
  background: var(--ide-bg-elevated);
  border-top: 1px solid var(--ide-border);
  transition: height 200ms ease;
}
.terminal-panel.is-collapsed {
  height: 0;
  border-top: none;
  overflow: hidden;
}

.terminal-tabs {
  display: flex;
  align-items: center;
  height: 32px;
  background: var(--ide-bg-soft);
  border-bottom: 1px solid var(--ide-border);
  flex-shrink: 0;
  padding: 0 4px 0 8px;
}
.terminal-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--ide-text-secondary);
  cursor: pointer;
  background: var(--ide-bg-elevated);
}
.terminal-tab.is-active {
  color: var(--ide-text-primary);
  background: var(--ide-bg-base);
  box-shadow: 0 1px 0 var(--ide-accent);
}
.tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.terminal-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.terminal-action {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--ide-text-tertiary);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all 120ms ease;
}
.terminal-action:hover {
  background: var(--ide-bg-base);
  color: var(--ide-text-primary);
}
.terminal-action svg {
  width: 12px;
  height: 12px;
}

.terminal-body {
  flex: 1;
  overflow: auto;
  padding: 8px 12px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ide-text-secondary);
}
.terminal-line { white-space: pre-wrap; word-break: break-all; }
.terminal-line.is-error { color: var(--ide-danger); }
.terminal-line.is-success { color: var(--ide-success); }
.terminal-line.is-warn { color: var(--ide-warning); }
.terminal-line.is-info { color: var(--ide-text-tertiary); }
.terminal-line.is-accent { color: var(--ide-accent); }

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-top: 1px solid var(--ide-border);
  background: var(--ide-bg-base);
  flex-shrink: 0;
}
.terminal-prompt {
  color: var(--ide-accent);
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 600;
}
.terminal-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ide-text-primary);
  font-family: var(--font-mono, monospace);
  font-size: 12px;
}
.terminal-input-row input::placeholder {
  color: var(--ide-text-muted);
}

/* ============================================
   AI Chat Panel
   ============================================ */
.aichat {
  grid-area: aichat;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--ide-bg-elevated);
  border-left: 1px solid var(--ide-border);
  overflow: hidden;
}
.ide.is-aichat-collapsed .aichat { border-left: none; }

.aichat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 10px;
  border-bottom: 1px solid var(--ide-border);
  flex-shrink: 0;
  gap: 8px;
}
.aichat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.aichat-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--ide-accent), #22d3ee);
  color: #08080c;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}
.aichat-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ide-text-primary);
}
.aichat-status {
  font-size: 10px;
  color: var(--ide-text-tertiary);
  margin-top: 1px;
}
.aichat-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.aichat-action {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--ide-text-tertiary);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all 120ms ease;
}
.aichat-action:hover {
  background: var(--ide-bg-soft);
  color: var(--ide-text-primary);
}
.aichat-action svg {
  width: 13px;
  height: 13px;
}

.aichat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

.chat-msg {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
}
.chat-msg.user { background: rgba(34, 211, 238, 0.04); }
.chat-msg-avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
  background: var(--ide-bg-soft);
  color: var(--ide-text-secondary);
}
.chat-msg.user .chat-msg-avatar {
  background: rgba(34, 211, 238, 0.2);
  color: #22d3ee;
}
.chat-msg.ai .chat-msg-avatar {
  background: linear-gradient(135deg, var(--ide-accent), #22d3ee);
  color: #08080c;
}
.chat-msg-body {
  flex: 1;
  min-width: 0;
}
.chat-msg-name {
  font-size: 11px;
  color: var(--ide-text-tertiary);
  font-weight: 600;
  margin-bottom: 2px;
}
.chat-msg-text {
  color: var(--ide-text-primary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.chat-msg-text pre {
  margin: 6px 0;
  padding: 8px 10px;
  background: var(--ide-bg-base);
  border: 1px solid var(--ide-border);
  border-radius: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  overflow-x: auto;
}
.chat-msg-text code {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  padding: 1px 4px;
  background: var(--ide-bg-soft);
  border-radius: 3px;
}
.chat-msg-text pre code {
  padding: 0;
  background: transparent;
  border: none;
}
.chat-msg-text p { margin: 0 0 6px; }
.chat-msg-text p:last-child { margin-bottom: 0; }
.chat-msg-text strong { color: var(--ide-accent); font-weight: 600; }

.chat-msg-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ide-text-tertiary);
}
.chat-msg-actions button {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--ide-bg-soft);
  color: var(--ide-text-secondary);
  cursor: pointer;
  border: 1px solid var(--ide-border);
  font-size: 11px;
  transition: all 120ms ease;
}
.chat-msg-actions button:hover {
  background: var(--ide-bg-base);
  color: var(--ide-text-primary);
  border-color: var(--ide-border-strong);
}
.chat-msg-actions button.is-applied {
  background: var(--ide-accent-soft);
  color: var(--ide-accent);
  border-color: var(--ide-accent-border);
}

.aichat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--ide-border);
  flex-shrink: 0;
}
.quick-action {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ide-bg-soft);
  border: 1px solid var(--ide-border);
  color: var(--ide-text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 120ms ease;
}
.quick-action:hover {
  background: var(--ide-bg-base);
  border-color: var(--ide-accent-border);
  color: var(--ide-text-primary);
}

.aichat-input {
  border-top: 1px solid var(--ide-border);
  flex-shrink: 0;
  background: var(--ide-bg-base);
}

.aichat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px 0;
}
.aichat-attachments:empty { display: none; }

.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--ide-accent-soft);
  border: 1px solid var(--ide-accent-border);
  color: var(--ide-accent);
  font-size: 11px;
}
.attach-clear {
  padding: 2px 8px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid var(--ide-border);
  color: var(--ide-text-tertiary);
  font-size: 11px;
  cursor: pointer;
}
.attach-clear:hover { color: var(--ide-danger); border-color: var(--ide-danger); }

.aichat-input-box {
  padding: 8px 8px 8px;
}
.aichat-input-box textarea {
  width: 100%;
  background: var(--ide-bg-soft);
  border: 1px solid var(--ide-border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ide-text-primary);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: border-color 120ms ease;
  min-height: 36px;
  max-height: 160px;
}
.aichat-input-box textarea:focus {
  border-color: var(--ide-accent);
  background: var(--ide-bg-base);
}
.aichat-input-box textarea::placeholder { color: var(--ide-text-muted); }

.aichat-input-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 0 2px;
}
.input-icon-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--ide-text-tertiary);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all 120ms ease;
}
.input-icon-btn:hover {
  background: var(--ide-bg-soft);
  color: var(--ide-text-primary);
}
.input-icon-btn svg {
  width: 14px;
  height: 14px;
}
.ai-spacer { flex: 1; }
.ai-model-display {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--ide-bg-soft);
  border: 1px solid var(--ide-border);
  color: var(--ide-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.send-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 12px;
  border-radius: 5px;
  background: var(--ide-accent);
  color: #08080c;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 120ms ease;
}
.send-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.send-btn svg { width: 12px; height: 12px; }

/* ============================================
   Status Bar
   ============================================ */
.statusbar {
  grid-area: status;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--ide-statusbar-h);
  background: var(--ide-bg-elevated);
  border-top: 1px solid var(--ide-border);
  font-size: 11px;
  color: var(--ide-text-secondary);
  flex-shrink: 0;
  z-index: 3;
}

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

.status-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 100%;
  padding: 0 8px;
  font-size: 11px;
  color: var(--ide-text-secondary);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: background 120ms ease;
}
.status-item:hover { background: var(--ide-bg-soft); }
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.status-item svg { width: 12px; height: 12px; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 980px) {
  .ide {
    grid-template-columns: var(--ide-activitybar-w) 0 1fr 0;
  }
  .ide:not(.is-aichat-collapsed) {
    grid-template-columns: var(--ide-activitybar-w) 0 1fr 280px;
  }
  .topbar-center { display: none; }
}
