/**
 * Code-Agent — VS Code Dark Theme
 * Based on VS Code Dark+ color palette
 */

/* ── SITE-MATCHED COLOR VARIABLES ────────────────────────── */
:root {
  /* Site background palette — matches layout.css */
  --bg:              #0f0c29;
  --bg-gradient:     linear-gradient(to right, #24243e, #302b63, #0f0c29);
  --bg-sidebar:      rgba(15, 12, 41, 0.85);
  --bg-titlebar:     #1a1730;
  --bg-panel:        #110e2e;
  --bg-input:        rgba(36, 36, 62, 0.9);
  --bg-hover:        rgba(48, 43, 99, 0.6);
  --bg-active:       rgba(0, 174, 255, 0.15);
  --bg-highlight:    rgba(0, 174, 255, 0.25);

  /* Syntax colors — kept readable on dark purple */
  --vsc-blue:        #569cd6;
  --vsc-light-blue:  #9cdcfe;
  --vsc-green:       #4ec9b0;
  --vsc-string:      #ce9178;
  --vsc-comment:     #6a9955;
  --vsc-yellow:      #dcdcaa;
  --vsc-purple:      #c586c0;
  --vsc-number:      #b5cea8;
  --vsc-white:       #ccd6f6;
  --vsc-red:         #f44747;
  --vsc-warning:     #cca700;

  /* UI colors — site palette */
  --border:          rgba(0, 174, 255, 0.25);
  --border-focus:    #00aeff;
  --border-active:   #00aeff;
  --text:            #ccd6f6;
  --text-muted:      #8892b0;
  --text-dim:        #4a5568;
  --radius:          6px;

  /* Site accent — #00aeff */
  --accent:          #00aeff;
  --accent-hover:    #33bfff;
  --accent-dim:      rgba(0, 174, 255, 0.12);

  /* Glow effects */
  --glow-blue:       0 0 12px rgba(0, 174, 255, 0.4);
  --glow-green:      0 0 10px rgba(78, 201, 176, 0.3);
  --glow-red:        0 0 10px rgba(244, 71, 71, 0.3);
}

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

html,
body {
  height: 100%;
}

body {
  font-family: "JetBrains Mono", "Consolas", "Courier New", monospace;
  background: var(--bg-gradient) !important;
  color: var(--text);
  cursor: default;
  font-size: 13px;
}

/* ── GRID BG ─────────────────────────────────────────────── */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── SCANLINES ───────────────────────────────────────────── */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* ── PARTICLES ───────────────────────────────────────────── */
.particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0%   { opacity: 0; transform: translateY(100vh) scale(0); }
  10%  { opacity: 0.5; }
  90%  { opacity: 0.2; }
  100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* ── LANDING ─────────────────────────────────────────────── */
.landing {
  position: fixed; top: 56px; left: 0; right: 0; bottom: 42px; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-gradient);
  transition: opacity 1s ease, visibility 1s ease;
  overflow: hidden;
}

.landing::before, .landing::after {
  content: '';
  position: absolute;
  width: 120px; height: 120px;
  border-color: #00f0ff;
  border-style: solid;
  animation: cornerPulse 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.landing::before { top: 40px; left: 40px; border-width: 2px 0 0 2px; }
.landing::after  { bottom: 40px; right: 40px; border-width: 0 2px 2px 0; }

@keyframes cornerPulse {
  0%,100% { opacity: 0.15; }
  50%     { opacity: 0.9; filter: drop-shadow(0 0 14px #00f0ff); }
}

.landing.fade-out { opacity: 0; visibility: hidden; }

.landing-inner {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 28px;
  position: relative; z-index: 1;
  animation: landingEntrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes landingEntrance {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.glitch-wrapper { position: relative; }

.glitch {
  font-family: "Orbitron", monospace;
  font-size: clamp(48px, 9vw, 88px);
  font-weight: 900;
  color: var(--accent);
  text-shadow: var(--glow-blue);
  letter-spacing: 10px;
  position: relative;
  animation: glitchMain 4s infinite;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  font-family: "Orbitron", monospace;
  font-size: inherit;
  font-weight: 900;
  letter-spacing: 10px;
}

.glitch::before {
  color: var(--vsc-purple);
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  animation: glitchTop 4s infinite;
  left: 3px;
}

.glitch::after {
  color: var(--vsc-green);
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  animation: glitchBot 4s infinite;
  left: -3px;
}

@keyframes glitchMain {
  0%,82%,100% { transform: translate(0); filter: none; }
  84% { transform: translate(-4px,2px); filter: hue-rotate(90deg) brightness(1.4); }
  86% { transform: translate(4px,-2px); filter: hue-rotate(-90deg); }
  88% { transform: translate(-2px,1px); }
  90% { transform: translate(2px,-1px); filter: brightness(1.6); }
}

@keyframes glitchTop {
  0%,82%,100% { transform: translate(0); opacity: 0; }
  84% { transform: translate(5px,-3px); opacity: 1; clip-path: polygon(0 5%, 100% 5%, 100% 35%, 0 35%); }
  86% { transform: translate(-5px,2px); opacity: 0.9; clip-path: polygon(0 15%, 100% 15%, 100% 40%, 0 40%); }
  88% { transform: translate(3px,-1px); opacity: 0.7; }
}

@keyframes glitchBot {
  0%,82%,100% { transform: translate(0); opacity: 0; }
  85% { transform: translate(-5px,3px); opacity: 1; clip-path: polygon(0 60%, 100% 60%, 100% 95%, 0 95%); }
  87% { transform: translate(5px,-2px); opacity: 0.9; clip-path: polygon(0 70%, 100% 70%, 100% 100%, 0 100%); }
  89% { transform: translate(-2px,1px); opacity: 0.7; }
}

.landing-sub {
  font-family: "Orbitron", monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 6px;
  color: var(--text-muted);
}

.landing-tags {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-muted);
  flex-wrap: wrap;
  justify-content: center;
}

.tag     { color: var(--vsc-light-blue); font-weight: 600; }
.tag-sep { color: var(--vsc-purple); animation: blink 1.4s step-end infinite; }

@keyframes blink { 50% { opacity: 0; } }

/* ── LAUNCH BUTTON ───────────────────────────────────────── */
.btn-launch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 56px;
  background: transparent;
  border: 1px solid #00f0ff;
  color: #00f0ff;
  font-family: "Orbitron", monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 4px;
  cursor: pointer;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 18px rgba(0,240,255,0.4), inset 0 0 20px rgba(0,240,255,0.05);
  transition: color 0.3s, transform 0.2s, box-shadow 0.3s;
  animation: btnPulse 2.5s ease-in-out infinite;
}

.btn-launch::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0,240,255,0.2), transparent);
  transform: translateX(-100%);
  animation: btnShimmer 2.5s ease-in-out infinite;
  z-index: 0;
}

.btn-launch::after {
  content: '';
  position: absolute; inset: 0;
  background: #00f0ff;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s ease; z-index: -1;
}

.btn-launch:hover {
  color: #030308;
  transform: translateY(-3px);
  box-shadow: 0 0 50px rgba(0,240,255,0.8), inset 0 0 30px rgba(0,240,255,0.1);
}

.btn-launch:hover::after { transform: scaleX(1); }

.btn-launch-text, .btn-launch-icon { position: relative; z-index: 1; }
.btn-launch-icon { animation: blink 1s step-end infinite; }

@keyframes btnPulse {
  0%,100% { box-shadow: 0 0 18px rgba(0,240,255,0.4), inset 0 0 20px rgba(0,240,255,0.05); }
  50%     { box-shadow: 0 0 35px rgba(0,240,255,0.7), inset 0 0 30px rgba(0,240,255,0.12); }
}
@keyframes btnShimmer {
  0%     { transform: translateX(-100%); opacity: 0; }
  20%    { opacity: 1; }
  60%,100% { transform: translateX(200%); opacity: 0; }
}

/* ── APP SHELL ───────────────────────────────────────────── */
.app {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 42px;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.app.hidden { display: none; }

/* ── TOPBAR — slim tab bar ───────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  height: 36px;
  background: rgba(15, 12, 41, 0.95);
  border-bottom: 1px solid rgba(0, 174, 255, 0.3);
  flex-shrink: 0;
  z-index: 20;
}

/* ── TAB NAV — VS Code file tabs ────────────────────────── */
.tab-nav {
  display: flex;
  gap: 0;
  height: 100%;
  align-items: flex-end;
  flex: 1;
  justify-content: center;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  height: 36px;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(0, 174, 255, 0.15);
  border-top: 2px solid transparent;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover {
  background: rgba(0, 174, 255, 0.08);
  color: var(--text);
}

.tab-btn.active {
  background: rgba(0, 174, 255, 0.12);
  color: #ffffff;
  border-top-color: var(--accent);
}

.tab-btn-icon {
  font-size: 8px;
  color: var(--accent);
  animation: blink 2s step-end infinite;
}

.tab-btn.active .tab-btn-icon { color: var(--vsc-yellow); }

/* ── STATUS BAR — VS Code bottom bar style ──────────────── */
.topbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 1px;
  color: #ffffff;
  background: var(--accent);
  padding: 3px 12px;
  margin-right: 8px;
  border-radius: 3px;
  white-space: nowrap;
}

.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── SCREENS ─────────────────────────────────────────────── */
.screen { display: none; flex: 1; overflow-y: auto; min-height: 0; }

.screen.active {
  display: flex;
  flex-direction: column;
  animation: screenIn 0.2s ease;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen::-webkit-scrollbar       { width: 10px; }
.screen::-webkit-scrollbar-track { background: var(--bg); }
.screen::-webkit-scrollbar-thumb { background: #424242; border-radius: 0; }
.screen::-webkit-scrollbar-thumb:hover { background: #4e4e4e; }

.screen-inner {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.screen-inner.wide { max-width: 1200px; }

/* ── SCREEN TITLE ────────────────────────────────────────── */
.screen-title {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.screen-title h2 {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 3px;
  white-space: nowrap;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* VS Code blue accent on highlighted words */
.neon-text {
  color: var(--vsc-light-blue);
  text-shadow: none;
}

.title-line {
  flex: 1;
  height: 1px;
  opacity: 0.2;
  background: linear-gradient(90deg, var(--border), transparent);
}

.title-line:first-child {
  background: linear-gradient(270deg, var(--border), transparent);
}

/* ── COPILOT LAYOUT ──────────────────────────────────────── */
.copilot-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  flex: 1;
  min-height: 0;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── PANELS ──────────────────────────────────────────────── */
.editor-panel,
.output-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-height: 420px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--vsc-comment);
}

/* ── CODE EDITOR ─────────────────────────────────────────── */
.editor-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.line-numbers {
  padding: 12px 8px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  color: #858585;
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
  white-space: pre;
  user-select: none;
  min-width: 44px;
  overflow: hidden;
  font-family: "JetBrains Mono", monospace;
}


.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: var(--accent);
  flex-shrink: 0;
}

.line-count {
  font-size: 11px;
  letter-spacing: 1px;
  color: #ffffff;
  font-family: "JetBrains Mono", monospace;
}

.editor-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── OUTPUT PANEL ────────────────────────────────────────── */
.output-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.8;
  padding: 24px;
}

.empty-icon {
  font-size: 36px;
  color: var(--text-dim);
  animation: emptyPulse 3s ease-in-out infinite;
}

@keyframes emptyPulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.7; }
}

.output-result {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 14px;
  gap: 12px;
}

.output-result::-webkit-scrollbar       { width: 10px; }
.output-result::-webkit-scrollbar-track { background: var(--bg); }
.output-result::-webkit-scrollbar-thumb { background: #424242; }

/* ── BADGES — VS Code diagnostic style ──────────────────── */
.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.badge {
  padding: 3px 10px;
  border-radius: 2px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid;
}

.badge.error   { color: var(--vsc-red);     border-color: rgba(244,71,71,0.4);   background: rgba(244,71,71,0.1); }
.badge.warning { color: var(--vsc-warning); border-color: rgba(204,167,0,0.4);   background: rgba(204,167,0,0.1); }
.badge.ok      { color: var(--vsc-green);   border-color: rgba(78,201,176,0.4);  background: rgba(78,201,176,0.1); }
.badge.info    { color: var(--vsc-blue);    border-color: rgba(86,156,214,0.4);  background: rgba(86,156,214,0.1); }

.review-body {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
  font-family: "JetBrains Mono", monospace;
}

.review-body code {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 5px;
  color: var(--vsc-string);
  font-family: "JetBrains Mono", monospace;
}

/* ── ASK BAR ─────────────────────────────────────────────── */
.ask-bar {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-sidebar);
  overflow: hidden;
  flex-shrink: 0;
}

.ask-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}

.ask-answer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
  background: var(--bg);
  max-height: 200px;
  overflow-y: auto;
  font-family: "JetBrains Mono", monospace;
}

/* ── LANGUAGE SELECT ─────────────────────────────────────── */
.cyber-select-sm {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--vsc-light-blue);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 4px 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
}

.cyber-select-sm:focus {
  border-color: var(--accent);
}

/* ── INPUTS ──────────────────────────────────────────────── */
.prompt-symbol {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--vsc-green);
  flex-shrink: 0;
}

.cyber-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  caret-color: var(--text);
}

.cyber-input::placeholder { color: var(--text-muted); }

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--bg-input);
  transition: border-color 0.15s;
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

.cyber-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 12px 14px;
  outline: none;
  resize: vertical;
  min-height: 160px;
  caret-color: var(--text);
  transition: border-color 0.15s;
}

.cyber-textarea::placeholder { color: var(--text-muted); }

.cyber-textarea:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-cyber {
  padding: 6px 16px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #ffffff;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.btn-cyber:hover { background: var(--accent-hover); }

.btn-cyber.wide {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
}

/* Pink = VS Code red/error color */
.btn-cyber.neon-pink {
  background: #6c2022;
  border-color: var(--vsc-red);
  color: var(--vsc-red);
}

.btn-cyber.neon-pink:hover {
  background: var(--vsc-red);
  color: #ffffff;
}

/* Green = VS Code teal */
.btn-cyber.neon-green {
  background: transparent;
  border-color: var(--vsc-green);
  color: var(--vsc-green);
}

.btn-cyber.neon-green:hover {
  background: var(--vsc-green);
  color: var(--bg);
}

.btn-ghost-cyber {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  cursor: pointer;
  border-radius: var(--radius);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
}

.btn-ghost-cyber:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-dim);
}

.btn-ghost-cyber.green:hover {
  border-color: var(--vsc-green);
  color: var(--vsc-green);
}

/* ── CHAT ─────────────────────────────────────────────────── */
.chat-window {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 340px;
  max-height: 420px;
}

.chat-window::-webkit-scrollbar       { width: 10px; }
.chat-window::-webkit-scrollbar-track { background: var(--bg); }
.chat-window::-webkit-scrollbar-thumb { background: #424242; }

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: msgIn 0.2s ease;
}

.chat-msg.user { align-items: flex-end; }

@keyframes msgIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--vsc-comment);
}

.chat-msg.user .msg-label { color: var(--vsc-yellow); }

.msg-body {
  max-width: 75%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--bg-sidebar);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.7;
  font-family: "JetBrains Mono", monospace;
}

.chat-msg.user .msg-body {
  border-left: 2px solid var(--accent);
  background: var(--accent-dim);
}

.msg-time {
  font-size: 10px;
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
}

.chat-bar {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
}

.chat-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}

/* ── RESEARCH ─────────────────────────────────────────────── */
.research-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cyber-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--vsc-comment);
}

.report-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: screenIn 0.3s ease;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sidebar);
}

.report-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--vsc-yellow);
}

.report-badge.green { color: var(--vsc-green); }

.report-body {
  padding: 18px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text);
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  font-family: "JetBrains Mono", monospace;
  background: var(--bg);
}

/* ── LOADER — VS Code progress bar style ────────────────── */
.cyber-loader {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 0;
}

.loader-bar {
  width: 100%;
  height: 2px;
  background: var(--border);
  border-radius: 0;
  overflow: hidden;
}

.loader-fill {
  height: 100%;
  background: var(--accent);
  animation: loaderSweep 1.4s ease-in-out infinite;
}

.loader-fill.pink  { background: var(--vsc-red); }
.loader-fill.green { background: var(--vsc-green); }

@keyframes loaderSweep {
  0%   { width: 0%;  margin-left: 0; }
  50%  { width: 60%; margin-left: 20%; }
  100% { width: 0%;  margin-left: 100%; }
}

.loader-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-muted);
  animation: blink 1.2s step-end infinite;
}

/* ── TTS ──────────────────────────────────────────────────── */
.tts-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.char-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.char-count {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}

/* ── VOICE GRID ──────────────────────────────────────────── */
.voice-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.voice-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.3;
}

.voice-chip span  { font-size: 11px; color: var(--text); }
.voice-chip small { font-size: 9px; letter-spacing: 0.5px; color: var(--text-muted); }

.voice-chip:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.voice-chip.active {
  border-color: var(--vsc-green);
  background: rgba(78, 201, 176, 0.08);
  color: var(--vsc-green);
  box-shadow: var(--glow-green);
}

.voice-chip.active span { color: var(--vsc-green); }

/* ── AUDIO PLAYER ────────────────────────────────────────── */
.player-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 16px;
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sidebar);
}

.cyber-audio {
  width: 100%;
  padding: 12px 16px;
  accent-color: var(--accent);
  display: block;
  background: var(--bg);
}

/* ── EDITOR CONTAINER — overlay technique ───────────────── */

/* ── EDITOR CONTAINER ───────────────────────────────────── */
.editor-container {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #0d0b22;
}

/* Highlight layer — behind textarea, shows colored spans */
.code-highlight {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  padding: 12px 16px;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: hidden;
  pointer-events: none;
  color: #d4d4d4;
  background: transparent;
  tab-size: 2;
  z-index: 1;
  margin: 0; border: 0;
}

/* Textarea — transparent so highlight shows through */
.code-editor {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: transparent;
  border: none; outline: none;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: #aeafad;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 13px; line-height: 1.6;
  padding: 12px 16px;
  resize: none; tab-size: 2;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: auto;
  z-index: 2; margin: 0;
}

.code-editor::placeholder {
  -webkit-text-fill-color: rgba(133,133,133,0.5);
  font-style: italic;
}

.code-editor::selection {
  background: rgba(38,79,120,0.8);
}

/* ── SYNTAX TOKEN COLORS — VS Code Dark+ palette ────────── */

/* Keywords: blue — if, def, class, const, return */
.tok-keyword    { color: #569cd6; }

/* Built-ins: light blue — print, console, Math */
.tok-builtin    { color: #9cdcfe; }

/* Strings: orange — "hello", 'world' */
.tok-string     { color: #ce9178; }

/* Comments: green — # this is a comment */
.tok-comment    { color: #6a9955; font-style: italic; }

/* Function names: yellow — def myFunc() */
.tok-funcname   { color: #dcdcaa; }

/* Class names: teal — class MyClass, Array, String */
.tok-classname  { color: #4ec9b0; }

/* Numbers: light green — 42, 3.14 */
.tok-number     { color: #b5cea8; }

/* Decorators: yellow-green — @staticmethod, #include */
.tok-decorator  { color: #c8c862; }

/* Variables: light blue — CSS vars, SQL columns */
.tok-variable   { color: #9cdcfe; }

/* ── UTILITY ──────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── SYNTAX TOKEN COLORS — fits neon theme ────────────────── */
.code-highlight { color: #c8e8ff; }

/* Keywords — neon blue */
.tok-keyword    { color: #00f0ff; }

/* Strings — neon pink/orange */
.tok-string     { color: #ff79c6; }

/* Comments — muted green */
.tok-comment    { color: #6a9955; font-style: italic; }

/* Function names — neon yellow */
.tok-funcname   { color: #ffe600; }

/* Class names — neon green */
.tok-classname  { color: #00ff88; }

/* Built-ins — light blue */
.tok-builtin    { color: #9cdcfe; }

/* Numbers — light green */
.tok-number     { color: #b5cea8; }

/* Decorators — orange */
.tok-decorator  { color: #ff9500; }

/* Variables — light blue */
.tok-variable   { color: #9cdcfe; }

/* ── EDITOR CONTAINER for neon theme ─────────────────────── */
.editor-container {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.code-highlight {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: hidden;
  pointer-events: none;
  color: #c8e8ff;
  background: transparent;
  tab-size: 2;
  z-index: 1;
  margin: 0; border: 0;
}

/* Override textarea to be transparent overlay */
.code-editor {
  position: absolute !important;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: transparent !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  caret-color: #00f0ff !important;
  z-index: 2;
  resize: none;
}

.code-editor::placeholder {
  -webkit-text-fill-color: rgba(0,240,255,0.2) !important;
  font-style: italic;
}

/* ── SCAN LINE SWEEP ──────────────────────────────────────── */
.scan-line {
  position: absolute;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent 0%, #00f0ff 30%, #00f0ff 70%, transparent 100%);
  opacity: 0.12;
  animation: scanSweep 5s linear infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes scanSweep {
  0%   { top: 0; opacity: 0; }
  5%   { opacity: 0.15; }
  95%  { opacity: 0.15; }
  100% { top: 100%; opacity: 0; }
}