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

:root {
  --bg: #0b0e12;
  --surface: #10151b;
  --surface2: #171d24;
  --surface3: #1c242c;
  --border: rgba(174, 190, 204, 0.07);
  --border-hi: rgba(174, 190, 204, 0.2);
  --accent: #45b7cf;
  --accent-dim: #3b8292;
  --accent-glow: rgba(69, 183, 207, 0.1);
  --text: #cbd4dc;
  --text-dim: #627384;
  --green: #4fd39a;
  --green-glow: rgba(79, 211, 154, 0.1);
  --red: #e66b71;
  --yellow: #d5a667;
  --user-bubble: #111a23;
  --assistant-bubble: #10151b;
  --chat-panel-ratio: 0.34375;
  --panel-width: calc(100vw * var(--chat-panel-ratio));
}

html, body {
  height: 100%;
  font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', 'Courier New', monospace;
  background: var(--bg); color: var(--text); overflow: hidden;
}

/* Dot-grid across entire canvas */
body::before {
  content: ''; position: fixed; inset: 0;
  background-image: radial-gradient(circle, rgba(177,193,207,0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none; z-index: 0;
}

/* ── Layout ─────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; position: relative; z-index: 1; }

header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 52px;
  background: linear-gradient(100deg, #0d1217, var(--surface) 42%, #0e1319);
  border-bottom: 1px solid var(--border); flex-shrink: 0; gap: 12px;
  position: relative; overflow: hidden;
}
/* Circuit-trace accent line across top of header */
header::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(191,205,217,0.12) 30%, rgba(191,205,217,0.05) 70%, transparent 100%);
}

.logo {
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 12px; text-transform: uppercase;
}
.logo-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent), 0 0 18px rgba(69,183,207,0.16);
  animation: pulse-dot 2.5s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 8px var(--accent), 0 0 20px var(--accent-glow); }
  50%       { box-shadow: 0 0 3px var(--accent), 0 0 6px rgba(69,183,207,0.06); }
}
.logo-name { display: inline-flex; align-items: baseline; color: var(--text); }
.logo-bracket { color: var(--accent); font-size: 15px; line-height: 1; text-shadow: 0 0 8px rgba(69,183,207,0.18); }
.logo-word { margin: 0 2px; color: #d7e1eb; letter-spacing: 0.17em; }
.logo-studio { margin-left: 9px; color: #a7b5c4; font-size: 10.5px; letter-spacing: 0.1em; }

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

/* Shared button system: secondary by default, with explicit primary/ghost variants. */
.btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px;
  border-radius: 2px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.018); color: #7f8e9d;
  font-size: 10px; font-family: inherit; font-weight: 500;
  cursor: pointer; transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
  white-space: nowrap; text-transform: uppercase; letter-spacing: 0.08em;
}
.btn:hover { border-color: rgba(69,183,207,0.42); color: #b8e4ed; background: rgba(69,183,207,0.06); }
.btn.primary {
  border-color: rgba(69,183,207,0.38); color: #e1f3f6;
  background: linear-gradient(180deg, rgba(54,145,165,0.62), rgba(36,103,119,0.62));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.btn.primary:hover { border-color: rgba(98,201,222,0.6); background: linear-gradient(180deg, rgba(62,157,178,0.76), rgba(39,112,129,0.76)); box-shadow: 0 0 12px var(--accent-glow); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { border-color: var(--border); background: rgba(255,255,255,0.025); }
.btn.danger:hover { border-color: var(--red); color: var(--red); box-shadow: 0 0 8px rgba(255,85,85,0.15); }

.panels { display: flex; flex: 1; overflow: hidden; }
