/* ─── Global background ─────────────────────────────────────────────────── */
body {
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(168, 85, 247, 0.10), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 42%, #f8fafc 100%);
}

/* ─── Decorative grid overlay ────────────────────────────────────────────── */
.console-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 72%);
}

/* ─── Glassmorphism panel ────────────────────────────────────────────────── */
.panel-glass {
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(16px);
}

/* ─── Endpoint pill ──────────────────────────────────────────────────────── */
.endpoint-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 0.95rem;
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.endpoint-pill-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4f46e5;
}

.endpoint-pill code {
  flex: 1 1 320px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
  color: #0f172a;
}

.endpoint-pill-note {
  font-size: 0.75rem;
  line-height: 1rem;
  color: #64748b;
  background: rgba(241, 245, 249, 0.9);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
}

/* ─── Prose (markdown) ───────────────────────────────────────────────────── */
.prose pre {
  background-color: #1e1e1e;
  color: #d4d4d4;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875em;
  padding: 0.2em 0.4em;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose p {
  margin-bottom: 1rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.prose ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ─── Message animations ─────────────────────────────────────────────────── */
.msg-anim {
  animation: fadeIn 0.3s ease;
}

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

/* ─── Message surface (AI bubble + textarea wrapper) ────────────────────── */
.message-surface {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ─── User message bubble ────────────────────────────────────────────────── */
.message-user-bubble {
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.96), rgba(226, 232, 240, 0.92));
  border-color: rgba(203, 213, 225, 0.8);
}

/* ─── Thinking block ─────────────────────────────────────────────────────── */
.thinking-block {
  font-style: italic;
  color: #6b7280;
  border-left: 2px solid #e5e7eb;
  padding-left: 1rem;
  margin-bottom: 1rem;
  white-space: pre-wrap;
  font-size: 0.9em;
}

/* ─── Tool block ─────────────────────────────────────────────────────────── */
.tool-block {
  font-family: monospace;
  background: #f3f4f6;
  color: #374151;
  padding: 0.5rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  font-size: 0.85em;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .endpoint-pill {
    align-items: flex-start;
  }

  .endpoint-pill-note {
    width: 100%;
  }
}
