:root {
  --bg-canvas: #0b0e14;
  --bg-surface: #111621;
  --bg-elevated: #171e2c;
  --bg-hover: #1e2738;
  --border-subtle: #222c3f;
  --border-strong: #2f3d56;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-brand: #06b6d4;
  --accent-brand-hover: #0891b2;
  --accent-brand-soft: rgba(6, 182, 212, 0.14);

  --status-online: #10b981;
  --status-online-soft: rgba(16, 185, 129, 0.14);
  --status-handoff: #f59e0b;
  --status-handoff-soft: rgba(245, 158, 11, 0.15);
  --status-danger: #ef4444;
  --status-danger-soft: rgba(239, 68, 68, 0.14);

  --bubble-user: #1a2333;
  --bubble-ai: #0e2933;
  --bubble-ai-border: #154555;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
  height: 100%;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

code, pre, .mono-meta {
  font-family: var(--font-mono);
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.login-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(6, 182, 212, 0.08), transparent 45%),
    radial-gradient(circle at 82% 80%, rgba(16, 185, 129, 0.06), transparent 45%),
    var(--bg-canvas);
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-brand {
  margin-bottom: 24px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  margin-bottom: 14px;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-brand);
  box-shadow: 0 0 10px var(--accent-brand);
}

.brand-code {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-brand);
  letter-spacing: 0.06em;
}

.login-brand h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-brand p {
  color: var(--text-secondary);
  font-size: 13.5px;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.field-group input {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: border-color 0.15s ease;
}

.field-group input:focus {
  outline: none;
  border-color: var(--accent-brand);
}

.alert-error {
  padding: 10px 12px;
  background: var(--status-danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  border-radius: 8px;
  font-size: 13px;
}

.login-footer-meta {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
button {
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--accent-brand);
  color: #041318;
  font-weight: 600;
  font-size: 13.5px;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover {
  background: var(--accent-brand-hover);
  color: #ffffff;
}

.btn-Full, .btn-full {
  width: 100%;
  padding: 11px 16px;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--accent-brand);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.btn-danger-ghost {
  background: transparent;
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 500;
}

.btn-danger-ghost:hover {
  background: var(--status-danger-soft);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--accent-brand);
}

/* ==========================================================================
   APP SHELL & TOPBAR
   ========================================================================== */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.topbar {
  height: 58px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  flex-shrink: 0;
  gap: 16px;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-brand);
  box-shadow: 0 0 10px var(--accent-brand);
}

.logo-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.logo-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}

.divider-v {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
}

.bot-selector {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.bot-selector:focus {
  outline: none;
  border-color: var(--accent-brand);
}

.tenant-locked-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-tab.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.nav-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--accent-brand-soft);
  color: var(--accent-brand);
}

.dirty-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-handoff);
}

.bot-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.bot-status-pill.is-online {
  background: var(--status-online-soft);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.bot-status-pill.is-offline {
  background: var(--status-handoff-soft);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.user-Session {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Setup Banner */
.setup-banner {
  background: rgba(245, 158, 11, 0.1);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  flex-shrink: 0;
}

.setup-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fde68a;
}

.setup-badge {
  background: var(--status-handoff);
  color: #0b0e14;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* ==========================================================================
   WORKSPACE VIEWS
   ========================================================================== */
.workspace-view {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   VIEW 1: CHAT / MESSAGES CONSOLE
   ========================================================================== */
.chat-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  height: 100%;
  overflow: hidden;
}

.contacts-panel {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.contacts-header {
  padding: 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contacts-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.contacts-title-row h2 {
  font-size: 14.5px;
  font-weight: 700;
}

.contacts-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auto-refresh-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-secondary);
  cursor: pointer;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text-muted);
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 100%;
  font-size: 13px;
  font-family: var(--font-sans);
}

.search-box input:focus {
  outline: none;
}

.filter-tabs {
  display: flex;
  gap: 6px;
}

.filter-chip {
  flex: 1;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.filter-chip.active {
  background: var(--accent-brand-soft);
  border-color: rgba(6, 182, 212, 0.4);
  color: var(--accent-brand);
}

.contacts-list {
  flex: 1;
  overflow-y: auto;
}

.contact-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-primary);
  transition: background 0.12s ease;
}

.contact-item:hover {
  background: var(--bg-elevated);
}

.contact-item.active {
  background: var(--bg-hover);
  border-left: 3px solid var(--accent-brand);
}

.contact-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.contact-item-phone {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
}

.contact-status-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.contact-status-tag.tag-ai {
  background: var(--status-online-soft);
  color: #34d399;
}

.contact-status-tag.tag-paused {
  background: var(--status-handoff-soft);
  color: #fbbf24;
}

.contact-item-preview {
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Conversation Right Pane */
.conversation-viewport {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-canvas);
  overflow: hidden;
}

.chat-empty-state {
  margin: auto;
  max-width: 380px;
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--accent-brand);
}

.chat-empty-state h3 {
  color: var(--text-primary);
  font-size: 16px;
  margin-bottom: 6px;
}

.chat-active-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.chat-pane-header {
  padding: 12px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.chat-contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-brand-soft);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--accent-brand);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-phone-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-phone-row h3 {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}

.handoff-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
}

.handoff-badge.is-ai {
  background: var(--status-online-soft);
  color: #34d399;
}

.handoff-badge.is-human {
  background: var(--status-handoff-soft);
  color: #fbbf24;
}

.contact-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.wa-direct-link {
  color: var(--accent-brand);
  text-decoration: none;
  font-weight: 500;
}

.wa-direct-link:hover {
  text-decoration: underline;
}

.chat-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rag-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

/* Message Stream */
.messages-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 74%;
}

.msg-row.msg-human {
  align-self: flex-start;
}

.msg-row.msg-ai {
  align-self: flex-end;
}

.msg-row.msg-internal {
  align-self: center;
  max-width: 88%;
  width: 100%;
}

.msg-bubble {
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13.8px;
  line-height: 1.55;
  word-wrap: break-word;
}

.msg-human .msg-bubble {
  background: var(--bubble-user);
  border: 1px solid var(--border-subtle);
  border-top-left-radius: 3px;
  color: var(--text-primary);
}

.msg-ai .msg-bubble {
  background: var(--bubble-ai);
  border: 1px solid var(--bubble-ai-border);
  border-top-right-radius: 3px;
  color: #e2f8fc;
}

.msg-sender-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Internal Tool / RAG Card */
.rag-card {
  background: rgba(23, 30, 44, 0.75);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 12px;
  color: var(--text-secondary);
}

.rag-card summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-brand);
}

.rag-card-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11.5px;
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
  color: var(--text-secondary);
}

.chat-pane-footer {
  padding: 9px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

.footer-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   VIEW 2: CONFIGURATION & PROMPT STUDIO
   ========================================================================== */
.config-container {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
  overflow-y: auto;
}

.control-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
}

.control-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.eyebrow-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-brand);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.control-card h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.control-card p {
  color: var(--text-secondary);
  max-width: 68ch;
  font-size: 13.5px;
}

.master-switch-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 150px;
}

.master-switch {
  width: 64px;
  height: 34px;
  border-radius: 20px;
  background: var(--status-handoff-soft);
  border: 2px solid var(--status-handoff);
  position: relative;
  transition: all 0.2s ease;
}

.master-switch[aria-checked="true"] {
  background: var(--status-online-soft);
  border-color: var(--status-online);
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--status-handoff);
  transition: transform 0.2s ease, background 0.2s ease;
}

.master-switch[aria-checked="true"] .switch-thumb {
  transform: translateX(28px);
  background: var(--status-online);
}

.master-switch-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}

.control-card-footer {
  padding-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 12.5px;
}

.meta-label {
  color: var(--text-muted);
  margin-right: 6px;
}

/* Prompt Studio */
.prompt-studio-card {
  flex: 1;
  min-height: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.prompt-studio-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.prompt-studio-header h2 {
  font-size: 16px;
}

.prompt-studio-header p {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.prompt-studio-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.save-feedback {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #34d399;
}

.prompt-studio-body {
  flex: 1;
  display: grid;
  grid-template-columns: 250px 1fr;
  overflow: hidden;
}

.prompt-outline {
  background: var(--bg-canvas);
  border-right: 1px solid var(--border-subtle);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.outline-header {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.outline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.outline-item-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outline-item-btn:hover {
  background: var(--bg-elevated);
  color: var(--accent-brand);
}

.prompt-metrics {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: var(--text-muted);
}

.metric-item strong {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 13px;
}

.prompt-editor-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.prompt-textarea {
  flex: 1;
  width: 100%;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: none;
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  resize: none;
}

.prompt-textarea:focus {
  outline: none;
}

/* ==========================================================================
   VIEW 3: SQL & N8N INTEGRATION GUIDE
   ========================================================================== */
.sql-guide-container {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
}

.diagnostics-card, .guide-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px 20px;
}

.diagnostics-header, .guide-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.diag-item {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diag-status {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.diag-status.ok {
  color: #34d399;
}

.diag-status.pending {
  color: #fbbf24;
}

.guide-columns {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.code-block {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
  font-size: 12px;
  line-height: 1.5;
  color: #cbd5e1;
  max-height: 440px;
  overflow: auto;
  white-space: pre;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-box {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 14px;
}

.step-box h4 {
  font-size: 13px;
  color: var(--accent-brand);
  margin-bottom: 4px;
}

.step-box p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.code-snippet {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11.5px;
  color: #e2e8f0;
  overflow-x: auto;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-brand);
  color: var(--text-primary);
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

@media (max-width: 960px) {
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .prompt-studio-body, .guide-columns {
    grid-template-columns: 1fr;
  }
}
