/* In-browser CLI playground — workspace overlay (top: 48px, right of
   sidebar). Behaves like the other apps; was previously a centered modal
   with backdrop blur. Click on the empty backdrop closes it. */
.cli-overlay {
  position: fixed;
  top: var(--chrome-h, 48px);
  left: var(--sidebar-w, 0);
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 999;
  padding: 24px 20px;
  overflow-y: auto;
}
.cli-overlay.hidden { display: none; }

.cli-modal {
  width: 100%;
  max-width: 960px;
  height: calc(100% - 24px);
  margin: 0 auto;
  background: #0a0f17;
  border: 1px solid var(--border, #1c2533);
  border-radius: 8px;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.cli-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(180, 79, 255, 0.12), transparent);
  border-bottom: 1px solid var(--border);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--text-primary);
}
.cli-head-title { letter-spacing: 0.04em; }
.cli-head-title .cli-prompt { color: #00D4FF; margin-right: 6px; font-weight: 600; }
.cli-head-title .cli-head-sub { color: var(--text-secondary); font-size: 11px; margin-left: 6px; }
.cli-close {
  background: none; border: none; color: var(--text-secondary);
  font-size: 22px; cursor: pointer; padding: 0 4px; line-height: 1;
}
.cli-close:hover { color: var(--text-primary); }

.cli-output {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  color: #d6e2ee;
  white-space: pre-wrap;
  word-break: break-word;
}
.cli-output .cli-line-cmd { color: #00D4FF; }
.cli-output .cli-line-cmd::before { content: "$ "; color: #5BC4A0; }
.cli-output .cli-line-err { color: #FF6B7A; }
.cli-output .cli-line-info { color: #8da3b8; }
.cli-output .cli-line-meta { color: #b48cff; font-size: 11px; }
.cli-output .cli-line-status {
  color: #ffd680;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0;
}
.cli-spinner {
  display: inline-block;
  width: 10px; height: 10px;
  border: 2px solid rgba(255, 214, 128, 0.25);
  border-top-color: #ffd680;
  border-radius: 50%;
  animation: cli-spin 0.7s linear infinite;
}
@keyframes cli-spin { to { transform: rotate(360deg); } }

.cli-run-btn.cli-stop-btn {
  background: rgba(255, 107, 122, 0.15);
  border-color: #ff6b7a;
  color: #ff6b7a;
}
.cli-run-btn.cli-stop-btn:hover { background: rgba(255, 107, 122, 0.25); }
.cli-input-row input:disabled { opacity: 0.6; }
.cli-output pre {
  margin: 4px 0 12px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid #243044;
  border-radius: 0 4px 4px 0;
  overflow-x: auto;
}

.cli-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: #060c14;
}
.cli-input-prompt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px; color: #5BC4A0; font-weight: 600;
  white-space: nowrap;
}
.cli-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  outline: none;
}
.cli-run-btn {
  background: rgba(0, 212, 255, 0.12);
  border: 1px solid #00D4FF;
  color: #00D4FF;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  cursor: pointer;
}
.cli-run-btn:hover { background: rgba(0, 212, 255, 0.2); }

.cli-foot {
  padding: 6px 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  background: #060c14;
}
.cli-foot code {
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  color: #00D4FF;
}
