﻿:root {
  --bg-app: #090a0f;
  --bg-panel: #0e1017;
  --bg-subtle: #141722;
  --border: #1b1f2e;
  --border-focus: #2a3147;
  --accent-cyan: #00f5d4;
  --accent-green: #10b981;
  --accent-purple: #7b2cbf;
  --accent-red: #ef4444;
  --text-primary: #ffffff;
  --text-secondary: #8c93a8;
  --font-ui: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html, body.studio-body {
  height: 100vh;
  width: 100vw;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-ui);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.studio-header {
  height: 44px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  flex-shrink: 0;
}

.header-left { display: flex; align-items: center; gap: 0.5rem; }
.studio-logo { width: 26px; height: 26px; display: flex; align-items: center; }
.logo-svg { width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(0, 245, 212, 0.4)); }
.studio-title { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.breadcrumb-separator { color: var(--border-focus); font-size: 0.8rem; }
.breadcrumb-item { font-size: 0.75rem; color: var(--text-secondary); }
.breadcrumb-file { font-size: 0.75rem; color: var(--accent-cyan); font-family: var(--font-mono); font-weight: 600; }

.header-right { display: flex; gap: 0.4rem; }
.studio-btn { background: var(--bg-subtle); color: var(--text-primary); border: 1px solid var(--border); font-size: 0.75rem; font-weight: 600; padding: 0.3rem 0.65rem; border-radius: 5px; cursor: pointer; transition: all 0.15s; }
.studio-btn:hover { border-color: var(--accent-cyan); }
.studio-btn-ghost { background: transparent; color: var(--text-secondary); }

/* Main 3-Column Studio Workspace (100% Height Fill) */
.studio-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 28% 44% 28%;
  gap: 1px;
  background: var(--border);
  overflow: hidden;
  height: calc(100vh - 44px - 32px);
}

@media (max-width: 1050px) {
  .studio-workspace { grid-template-columns: 1fr; overflow-y: auto; }
}

.studio-pane {
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.pane-header {
  height: 38px;
  padding: 0 0.8rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.pane-title { font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; gap: 0.4rem; color: var(--text-primary); }
.pane-icon { color: var(--accent-cyan); }
.pane-actions { display: flex; gap: 0.3rem; }

/* Assistant Pane */
.media-surface { background: #000; height: 95px; border-bottom: 1px solid var(--border); overflow: hidden; flex-shrink: 0; }
.media-preview { width: 100%; height: 100%; object-fit: cover; }

.chat-thread {
  flex: 1;
  background: #06070a;
  padding: 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.chat-bubble { padding: 0.6rem 0.75rem; border-radius: 6px; }
.ai-bubble { background: var(--bg-subtle); border: 1px solid var(--border); border-left: 3px solid var(--accent-cyan); }
.user-bubble { background: #181d2c; border: 1px solid var(--border-focus); margin-left: 1.5rem; }
.bubble-header { font-size: 0.65rem; color: var(--accent-cyan); font-weight: 700; margin-bottom: 0.2rem; }
.bubble-content { line-height: 1.4; word-break: break-word; }

.chat-input-wrapper {
  padding: 0.6rem;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.studio-input {
  flex: 1;
  background: #06070a;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.45rem 0.6rem;
  color: #fff;
  font-size: 0.8rem;
  outline: none;
}
.studio-input:focus { border-color: var(--accent-cyan); }

.btn-send {
  background: var(--accent-cyan);
  color: #000;
  border: none;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0 0.85rem;
  border-radius: 5px;
  cursor: pointer;
}

/* Editor Pane */
.editor-tabs-header { padding: 0; background: var(--bg-app); }
.tab {
  height: 100%;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  border-top: 2px solid var(--accent-cyan);
  font-size: 0.75rem;
  font-weight: 600;
}
.tab-icon { color: #f59e0b; font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700; }
.editor-actions { display: flex; align-items: center; gap: 0.4rem; padding-right: 0.6rem; }

.action-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
}
.pill-blue { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border-color: rgba(59, 130, 246, 0.3); }
.pill-green { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.3); }

.editor-area { flex: 1; display: flex; overflow: hidden; background: #06070a; }
.studio-code {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  padding: 0.75rem;
  color: #00f090;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  resize: none;
  outline: none;
}

.diff-drawer {
  height: 75px;
  background: #040508;
  border-top: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  flex-shrink: 0;
}
.diff-status-bar { font-size: 0.65rem; color: var(--text-secondary); margin-bottom: 0.2rem; }

/* Output Pane */
.preview-surface { height: 50%; background: #fff; border-bottom: 1px solid var(--border); overflow: hidden; }
.preview-frame { width: 100%; height: 100%; border: none; }

.console-drawer { flex: 1; display: flex; flex-direction: column; background: #06070a; overflow: hidden; }
.console-header { font-size: 0.65rem; color: var(--text-secondary); padding: 0.3rem 0.6rem; background: var(--bg-panel); border-bottom: 1px solid var(--border); }
.console-feed { flex: 1; padding: 0.5rem 0.6rem; overflow-y: auto; font-family: var(--font-mono); font-size: 0.75rem; display: flex; flex-direction: column; gap: 0.2rem; }
.console-line { word-break: break-all; }
.line-system { color: var(--accent-cyan); }
.line-success { color: var(--accent-green); }
.line-error { color: var(--accent-red); }

/* Pinned Status Bar (Zero Wasted Space) */
.studio-status-bar {
  height: 32px;
  background: #06070a;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.8rem;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.status-left { display: flex; align-items: center; gap: 0.6rem; }
.live-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.status-host { color: var(--text-secondary); font-family: var(--font-mono); }
.quick-snippets { display: flex; gap: 0.3rem; margin-left: 0.5rem; }
.snippet-btn { background: var(--bg-subtle); color: var(--text-primary); border: 1px solid var(--border); font-size: 0.65rem; padding: 2px 6px; border-radius: 3px; cursor: pointer; }
.snippet-btn:hover { border-color: var(--accent-cyan); }

.status-right { display: flex; align-items: center; gap: 0.5rem; }
.status-tool-btn { background: transparent; color: var(--accent-cyan); border: 1px solid rgba(0,245,212,0.3); font-size: 0.65rem; font-weight: 600; padding: 2px 6px; border-radius: 3px; cursor: pointer; }
.status-tool-btn:hover { background: var(--accent-cyan); color: #000; }
.panic-btn { background: rgba(239, 68, 68, 0.15); border: 1px solid var(--accent-red); color: var(--accent-red); font-size: 0.65rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; cursor: pointer; }
.panic-btn:hover { background: var(--accent-red); color: #fff; }

.hidden-telemetry, .hidden-hud { display: none; }

/* Buttons & Dialogs */
.tool-btn { background: var(--bg-subtle); color: #fff; border: 1px solid var(--border); font-size: 0.75rem; padding: 0.25rem 0.5rem; border-radius: 4px; cursor: pointer; }
.tool-btn-sm { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); font-size: 0.65rem; padding: 1px 5px; border-radius: 3px; cursor: pointer; }
.tool-btn.active { background: var(--accent-red); border-color: var(--accent-red); }

.studio-dialog { margin: auto; border: 1px solid var(--border-focus); background: var(--bg-panel); border-radius: 8px; color: #fff; max-width: 420px; width: 90%; padding: 1.2rem; box-shadow: 0 10px 30px rgba(0,0,0,0.9); }
.studio-dialog::backdrop { background: rgba(0,0,0,0.8); }
.dialog-box { display: flex; flex-direction: column; gap: 0.7rem; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; }
.dialog-title { font-size: 0.95rem; font-weight: 700; }
.dialog-close { background: none; border: none; color: var(--text-secondary); font-size: 1.25rem; cursor: pointer; }
.dialog-info { font-size: 0.75rem; color: var(--text-secondary); }
.dialog-form { display: flex; flex-direction: column; gap: 0.5rem; }
.studio-textarea { width: 100%; background: #06070a; border: 1px solid var(--border); border-radius: 5px; padding: 0.45rem 0.6rem; color: #fff; font-size: 0.8rem; outline: none; }
.dialog-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.action-btn { font-size: 0.75rem; font-weight: 600; padding: 0.4rem 0.8rem; border-radius: 4px; border: 1px solid transparent; cursor: pointer; }
.btn-cyan { background: var(--accent-cyan); color: #000; }
.btn-secondary { background: var(--bg-subtle); color: #fff; border-color: var(--border); }
.btn-danger { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); border-color: rgba(239, 68, 68, 0.4); }
.dialog-log { font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent-cyan); margin-top: 0.3rem; }