/* ==========================================================================
   ANTIGRAVITY IDE — EXACT 1:1 THEME & DESIGN SYSTEM
   Matches Google Antigravity IDE UI (Desktop & Cloud)
   ========================================================================== */

:root {
  --bg-darkest: #121214;       /* Activity bar background */
  --bg-sidebar: #18181b;       /* Explorer & Agent sidebar background */
  --bg-editor: #1e1e1e;        /* Active code editor canvas */
  --bg-hover: #27272a;         /* Interactive hover */
  --bg-active: #2f2f35;        /* Active item background */
  --bg-input: #202024;         /* Floating agent input background */

  --border-subtle: #27272a;    /* Pane divider border */
  --border-focus: #3f3f46;     /* Input focused border */
  --border-blue: #0078d4;      /* Active tab top indicator / primary brand */

  --blue-primary: #0078d4;     /* Antigravity blue */
  --blue-hover: #0066b8;
  --blue-badge: #0e639c;       /* Remote badge */
  --cyan-accent: #38bdf8;
  --green-online: #22c55e;
  --yellow-warn: #eab308;
  --red-error: #ef4444;

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-dim: #52525b;

  --font-ui: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", Menlo, Monaco, "Courier New", monospace;

  --activity-width: 48px;
  --sidebar-width: 270px;
  --agent-width: 420px;
  --titlebar-height: 36px;
  --statusbar-height: 24px;
}

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

body.vscode-dark {
  font-family: var(--font-ui);
  background-color: var(--bg-editor);
  color: var(--text-primary);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   1. macOS TITLE BAR (TOP 36px)
   ========================================================================== */
.window-titlebar {
  height: var(--titlebar-height);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 0.78rem;
  z-index: 100;
  flex-shrink: 0;
}

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

.window-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-block;
  transition: transform 0.15s ease;
}
.control-dot:hover { transform: scale(1.1); }
.control-dot.close { background: #ff5f56; border: 1px solid #e0443e; }
.control-dot.minimize { background: #ffbd2e; border: 1px solid #dea123; }
.control-dot.maximize { background: #27c93f; border: 1px solid #1aab29; }

.titlebar-app-icon {
  display: flex;
  align-items: center;
  color: #fff;
}

.titlebar-brand {
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.titlebar-center {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}

.titlebar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.titlebar-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.titlebar-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.titlebar-btn.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.titlebar-connection-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  color: var(--green-online);
  cursor: pointer;
}
.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-online);
  box-shadow: 0 0 8px var(--green-online);
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   2. MAIN IDE WORKSPACE GRID
   ========================================================================== */
.ide-main-container {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--titlebar-height) - var(--statusbar-height));
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* A. SLIM ACTIVITY BAR (48px) */
.activity-bar {
  width: var(--activity-width);
  background: var(--bg-darkest);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  flex-shrink: 0;
  z-index: 20;
}

.activity-bar-top, .activity-bar-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.activity-btn {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  border-radius: 6px;
  transition: color 0.15s ease;
}
.activity-btn:hover {
  color: var(--text-primary);
}
.activity-btn.active {
  color: #ffffff;
}
.activity-btn.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2.5px;
  background: #ffffff;
  border-radius: 0 2px 2px 0;
}

/* B. PRIMARY SIDEBAR (EXPLORER / WORKSPACES) */
.primary-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.primary-sidebar.collapsed {
  width: 0 !important;
  border-right: none;
}

.sidebar-top-bar {
  height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
}
.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn-subtle {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn-subtle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-section-header {
  height: 26px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}
.sidebar-section-header:hover {
  background: var(--bg-hover);
}
.tree-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.workspace-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.btn-micro {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 3px;
  cursor: pointer;
}
.btn-micro:hover {
  background: var(--blue-primary);
}

.workspace-filter-box {
  padding: 4px 8px;
}
.workspace-filter-box input {
  width: 100%;
  background: var(--bg-editor);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 3px;
  outline: none;
}
.workspace-filter-box input:focus {
  border-color: var(--blue-primary);
}

.workspaces-scroll {
  max-height: 180px;
  overflow-y: auto;
}

.ws-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 4px 20px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s ease;
}
.ws-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.ws-item.active {
  background: rgba(0, 120, 212, 0.2);
  color: #ffffff;
  font-weight: 600;
}
.ws-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Explorer Tree */
.explorer-tree {
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 0;
}
.empty-hint {
  padding: 10px 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tree-node-folder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px 3px 14px;
  font-size: 0.78rem;
  color: var(--cyan-accent);
  font-weight: 600;
  cursor: pointer;
}
.tree-node-folder:hover {
  background: var(--bg-hover);
}

.tree-node-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px 3px 26px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.tree-node-file:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tree-node-file.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 500;
}
.file-del-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  font-size: 0.7rem;
}
.tree-node-file:hover .file-del-btn, .tree-node-folder:hover .file-del-btn {
  opacity: 1;
}

.sidebar-collapsible-item {
  height: 24px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-collapsible-item:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* ==========================================================================
   C. CENTER STAGE (DUAL MODE: HOME VIEW OR CODE EDITOR)
   ========================================================================== */
.center-editor-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-editor);
  overflow: hidden;
  position: relative;
}

/* --- MODE 1: AUTHENTIC ANTIGRAVITY HOME / WELCOME VIEW --- */
.antigravity-home-view {
  flex: 1;
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 20px;
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 520px;
  width: 100%;
  text-align: center;
}

.antigravity-logo-mark {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.25));
}

.antigravity-title {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: #ffffff;
  margin-bottom: 24px;
}

.home-actions-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-bottom: 36px;
}

.btn-ide-primary {
  background: var(--blue-primary);
  border: 1px solid var(--blue-primary);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease;
}
.btn-ide-primary:hover {
  background: var(--blue-hover);
}

.btn-ide-secondary {
  background: #252528;
  border: 1px solid #333338;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease;
}
.btn-ide-secondary:hover {
  background: var(--bg-hover);
}

.home-workspaces-section {
  width: 100%;
  text-align: left;
}

.home-section-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
}

.home-workspaces-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.home-ws-card {
  background: #202024;
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.15s ease;
}
.home-ws-card:hover {
  background: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}
.home-ws-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
}
.home-ws-path {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.btn-link {
  background: none;
  border: none;
  color: var(--cyan-accent);
  font-size: 0.78rem;
  cursor: pointer;
  margin-top: 10px;
  text-align: left;
}
.btn-link:hover { text-decoration: underline; }

/* --- MODE 2: CODE EDITOR VIEW --- */
.code-editor-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-editor);
  overflow: hidden;
}

.editor-tabs-bar {
  height: 35px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.editor-tabs-scroll {
  display: flex;
  align-items: center;
  height: 100%;
  overflow-x: auto;
}

.editor-tab {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  cursor: pointer;
  white-space: nowrap;
}
.editor-tab:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}
.editor-tab.active {
  background: var(--bg-editor);
  color: #ffffff;
  border-top: 2px solid var(--border-blue);
}
.tab-close {
  font-size: 0.7rem;
  color: var(--text-dim);
  border-radius: 2px;
  padding: 1px 3px;
}
.tab-close:hover {
  background: var(--bg-hover);
  color: #ffffff;
}

.editor-tabs-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 8px;
}
.tab-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  cursor: pointer;
}
.tab-action-btn:hover {
  background: var(--bg-hover);
  color: #ffffff;
}

.editor-breadcrumbs {
  height: 22px;
  background: var(--bg-editor);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.crumb-ws { color: var(--text-secondary); }
.crumb-sep { font-size: 0.65rem; color: var(--text-dim); }
.crumb-file { color: #ffffff; font-weight: 500; }

.editor-body-wrapper {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
  background: var(--bg-editor);
}

.editor-gutter {
  width: 46px;
  background: var(--bg-editor);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  color: #6e7681;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  padding: 12px 6px;
  text-align: right;
  user-select: none;
  overflow: hidden;
  flex-shrink: 0;
}

.code-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  padding: 12px 14px;
  resize: none;
  outline: none;
  white-space: pre;
  tab-size: 4;
  overflow: auto;
}

.editor-minimap {
  width: 60px;
  background: rgba(0, 0, 0, 0.15);
  border-left: 1px solid rgba(255, 255, 255, 0.03);
  padding: 6px 2px;
  opacity: 0.6;
  flex-shrink: 0;
  overflow: hidden;
}
.minimap-preview {
  height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.15) 0px,
    rgba(255, 255, 255, 0.15) 2px,
    transparent 2px,
    transparent 5px
  );
}

/* ==========================================================================
   BOTTOM PANEL (TERMINAL / OUTPUT / DEPLOYMENTS)
   ========================================================================== */
.bottom-panel {
  height: 180px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: height 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.bottom-panel.collapsed {
  height: 0 !important;
  border-top: none;
}

.panel-header {
  height: 32px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.panel-tabs {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 2px;
}
.panel-tab-btn {
  height: 100%;
  background: none;
  border: none;
  padding: 0 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}
.panel-tab-btn:hover {
  color: var(--text-secondary);
}
.panel-tab-btn.active {
  color: #ffffff;
  border-bottom: 2px solid var(--blue-primary);
}
.badge-count {
  background: #3f3f46;
  color: #fff;
  font-size: 0.65rem;
  border-radius: 10px;
  padding: 0 5px;
}

.panel-content-area {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.panel-tab-body {
  display: none;
  height: 100%;
  overflow-y: auto;
}
.panel-tab-body.active {
  display: block;
}

.terminal-stdout {
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: #d4d4d8;
}
.term-line {
  margin-bottom: 2px;
  word-break: break-all;
}
.term-line.info { color: #93c5fd; }
.term-line.success { color: #86efac; }
.term-line.warning { color: #fde047; }
.term-line.error { color: #fca5a5; }
.term-dim { color: var(--text-muted); margin-right: 6px; }

.deployments-grid {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.deploy-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.deploy-item-url {
  color: var(--cyan-accent);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.deploy-item-url:hover { text-decoration: underline; }

/* ==========================================================================
   D. RIGHT SECONDARY SIDEBAR: THE ANTIGRAVITY AGENT PANEL
   ========================================================================== */
.agent-panel {
  width: var(--agent-width);
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.agent-panel.collapsed {
  width: 0 !important;
  border-left: none;
}

.agent-header {
  height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.agent-title-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.agent-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.agent-brand-sub {
  height: 28px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.agent-brand-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
}
.agent-target-badge {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.agent-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Chat Bubbles */
.agent-bubble {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.user-bubble-box {
  background: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #ffffff;
  align-self: flex-end;
  max-width: 90%;
}

.assistant-welcome {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
}
.welcome-heading {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}
.welcome-body {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}

.quick-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Thinking Dropdown & Response cards */
.thinking-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
}
.thinking-header {
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--cyan-accent);
  cursor: pointer;
  background: rgba(0, 242, 254, 0.03);
}
.thinking-body {
  padding: 8px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  max-height: 140px;
  overflow-y: auto;
  border-top: 1px solid var(--border-subtle);
}

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
  margin: 2px 0;
  font-family: var(--font-mono);
}
.action-pill.system { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.action-pill.agent { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; }
.action-pill.file { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.action-pill.deploy { background: rgba(234, 179, 8, 0.15); color: #fde047; }
.action-pill.success { background: rgba(34, 197, 94, 0.2); color: #4ade80; font-weight: 600; }

.live-preview-card {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
}
.live-preview-card h4 {
  font-size: 0.82rem;
  color: var(--green-online);
  margin-bottom: 4px;
}
.live-preview-link {
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: underline;
  word-break: break-all;
}

/* SIGNATURE ANTIGRAVITY FLOATING INPUT BOX */
.agent-input-container {
  padding: 10px 12px 14px 12px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.agent-input-box {
  background: var(--bg-input);
  border: 1px solid #333338;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.agent-input-box:focus-within {
  border-color: #52525b;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.agent-textarea {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  line-height: 1.45;
  resize: none;
  width: 100%;
}
.agent-textarea::placeholder {
  color: var(--text-dim);
}

.agent-input-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 4px;
}

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

.tool-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tool-btn:hover {
  background: var(--bg-hover);
  color: #ffffff;
}

.model-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.model-pill:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}
.pill-dot { font-size: 0.68rem; color: #f59e0b; }
.pill-arrow { font-size: 0.65rem; color: var(--text-dim); }

.mode-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-action-btn {
  background: #3b82f6;
  border: none;
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.send-action-btn:hover {
  background: #2563eb;
  transform: scale(1.05);
}
.send-action-btn:disabled {
  background: #3f3f46;
  opacity: 0.5;
  cursor: not-allowed;
}

.agent-disclaimer {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 6px;
}

/* History Drawer */
.agent-history-drawer {
  background: var(--bg-editor);
  border-top: 1px solid var(--border-subtle);
  max-height: 180px;
  overflow-y: auto;
  padding: 8px 12px;
}
.history-drawer-header {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

/* ==========================================================================
   3. BOTTOM STATUS BAR (24px)
   ========================================================================== */
.ide-statusbar {
  height: var(--statusbar-height);
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  z-index: 100;
  flex-shrink: 0;
}

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

.status-badge-remote {
  background: var(--blue-badge);
  border: none;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0 8px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.status-badge-remote:hover {
  background: var(--blue-primary);
}
.remote-icon {
  font-weight: 800;
  letter-spacing: -1px;
}

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

/* ==========================================================================
   4. MODALS & DIALOGS
   ========================================================================== */
.ide-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ide-modal-box {
  background: #202024;
  border: 1px solid #333338;
  border-radius: 10px;
  width: 100%;
  max-width: 420px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  animation: modalScale 0.15s ease-out;
}
@keyframes modalScale { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-brand-header {
  text-align: center;
  margin-bottom: 20px;
}
.modal-brand-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  margin: 10px 0 4px 0;
}
.modal-brand-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

.ide-form-group {
  margin-bottom: 14px;
  text-align: left;
}
.ide-form-group label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.ide-input {
  width: 100%;
  background: #18181b;
  border: 1px solid #333338;
  color: #ffffff;
  font-size: 0.82rem;
  padding: 8px 10px;
  border-radius: 4px;
  outline: none;
}
.ide-input:focus {
  border-color: var(--blue-primary);
}

.modal-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-error {
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--red-error);
  border-radius: 4px;
  color: var(--red-error);
  font-size: 0.78rem;
  margin-bottom: 14px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #2e2e34;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}
