/* ==========================================================================
   FEDERIS AGENTIC STUDIO — GENERAL CSS (BETA)
   Native Standard CSS replacing Tailwind CSS for Dashboard & Workflow Canvas
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand Green / Emerald Palette */
  --brand-50: #ecfdf5;
  --brand-100: #d1fae5;
  --brand-200: #a7f3d0;
  --brand-300: #6ee7b7;
  --brand-400: #34d399;
  --brand-500: #10b981;
  --brand-600: #059669;
  --brand-700: #047857;
  --brand-800: #065f46;
  --brand-900: #064e3b;

  /* Neutral Slate Palette */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Menlo, Monaco, "Courier New", monospace;

  /* Layout and Geometry */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(15, 23, 42, 0.18);

  /* Sidebar Overlay Drawer Dimensions */
  --copilot-width: 384px;
  --resources-width: 320px;
}

@media (max-width: 1023px) {
  :root {
    --copilot-width: 340px;
  }
}

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

html, body {
  height: 100%;
  width: 100%;
  background-color: var(--slate-50);
  color: var(--slate-800);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar,
.custom-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track,
.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb,
.custom-scroll::-webkit-scrollbar-thumb {
  background: var(--slate-200);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover,
.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--slate-300);
}

/* --------------------------------------------------------------------------
   VIEW CONTAINERS (Dashboard vs Canvas)
   -------------------------------------------------------------------------- */
.studio-view {
  display: none;
  width: 100%;
  height: 100%;
}

.studio-view.active {
  display: flex;
}

/* --------------------------------------------------------------------------
   DASHBOARD SCREEN (SCREEN 1) — NATIVE FULL-SCREEN APPLICATION LAYOUT
   -------------------------------------------------------------------------- */
.dashboard-screen-layout {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  background-color: #ffffff;
}

/* Dashboard Sidebar */
.dashboard-sidebar {
  width: 260px;
  height: 100vh;
  border-right: 1px solid var(--slate-200);
  background-color: #fafbfd;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
  padding: 24px 16px;
  flex-shrink: 0;
}

.sidebar-logo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 8px 8px;
}

.logo-brand-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-symbol-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background-color: var(--slate-900);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: var(--shadow-xs);
}

.logo-text-title {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--slate-900);
  font-size: 18px;
  line-height: 1.1;
}

.logo-badge-studio {
  background-color: rgba(209, 250, 229, 0.9);
  color: var(--brand-800);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 20px;
}

.sidebar-group-title {
  font-size: 11px;
  font-weight: 700;
  color: #8899a6;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0 10px 8px 10px;
  display: block;
  user-select: none;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #8899a6;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0 10px 8px 10px;
  display: block;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-md);
  color: #334155;
  text-decoration: none;
  transition: all 0.15s ease;
}

.sidebar-nav-item:hover {
  color: #0f172a;
  background-color: rgba(241, 245, 249, 0.85);
}

.sidebar-nav-item.active {
  background-color: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.05);
}

.sidebar-nav-item svg {
  color: #8899a6;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke: currentColor;
  transition: color 0.15s ease;
}

.sidebar-nav-item:hover svg {
  color: #475569;
}

.sidebar-nav-item.active svg {
  color: #059669;
}

.sidebar-bottom-actions {
  position: relative;
  padding-top: 14px;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}

/* Sidebar User Details Trigger (White Theme & Perfect Alignment) */
.sidebar-user-container {
  position: relative;
  width: 100%;
}

.sidebar-user-trigger {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.sidebar-user-trigger:hover,
.sidebar-user-trigger.active {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.07);
}

.sidebar-user-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0ea572;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.sidebar-user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
  text-align: left;
}

.sidebar-user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 125px;
}

.sidebar-user-tier {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;  /* long emails: shortened, full one on hover */
}

.sidebar-user-dots-icon {
  color: #94a3b8;
  flex-shrink: 0;
  margin-left: 6px;
  transition: color 0.15s ease;
}

.sidebar-user-trigger:hover .sidebar-user-dots-icon,
.sidebar-user-trigger.active .sidebar-user-dots-icon {
  color: #334155;
}

/* User Options Popover / Modal (White Theme & Perfect Alignment) */
.user-options-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.12), 0 6px 16px -2px rgba(15, 23, 42, 0.05);
  padding: 6px 0;
  z-index: 1000;
  box-sizing: border-box;
  animation: userPopoverIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes userPopoverIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.user-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  margin: 2px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  user-select: none;
}

.user-modal-header:hover {
  background-color: #f1f5f9;
}

.user-modal-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0ea572;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  margin-right: 10px;
  flex-shrink: 0;
}

.user-modal-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  line-height: 1.25;
  min-width: 0;
  text-align: left;
}

.user-modal-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-modal-plan {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-modal-chevron {
  color: #94a3b8;
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.15s ease, color 0.15s ease;
}

.user-modal-header:hover .user-modal-chevron,
.user-modal-item:hover .user-modal-chevron {
  color: #334155;
  transform: translateX(2px);
}

.user-modal-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 5px 8px;
}

.user-modal-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 6px;
}

.user-modal-item {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: #334155;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.user-modal-item:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.user-modal-icon {
  color: #64748b;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.user-modal-item:hover .user-modal-icon {
  color: #0f172a;
}

.user-modal-label {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.25;
}

/* Reusable Modal Dialog Overlay */
.federis-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  animation: modalOverlayFade 0.2s ease-out;
}

@keyframes modalOverlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.federis-modal-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.federis-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-200);
  background: var(--slate-50);
}

.federis-modal-close-btn {
  background: transparent;
  border: none;
  color: var(--slate-400);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.federis-modal-close-btn:hover {
  color: var(--slate-700);
  background: var(--slate-200);
}

.federis-modal-body {
  padding: 20px;
  font-size: 13.5px;
  color: var(--slate-700);
  max-height: 70vh;
  overflow-y: auto;
}

.federis-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--slate-200);
  background: var(--slate-50);
}

/* Dashboard Main Content */
.dashboard-main {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 40px 32px;
  background-color: #ffffff;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .dashboard-main {
    padding: 44px 56px;
  }
}

.dashboard-center-container {
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
}

.hero-title-area {
  margin-bottom: 32px;
}

.hero-title-area h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--slate-900);
}

.hero-title-area p {
  color: var(--slate-500);
  font-size: 14px;
  margin-top: 6px;
}

@media (min-width: 768px) {
  .hero-title-area h1 { font-size: 32px; }
  .hero-title-area p { font-size: 15px; }
}

/* Prompt Box */
.prompt-box-wrapper {
  position: relative;
  background-color: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.prompt-box-wrapper:hover {
  border-color: var(--slate-300);
}

.prompt-box-wrapper:focus-within {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.prompt-textarea {
  width: 100%;
  border: none;
  padding: 0;
  color: var(--slate-800);
  font-size: 16px;
  line-height: 1.5;
  resize: none;
  outline: none;
  background: transparent;
  min-height: 96px;
}

.prompt-textarea::placeholder {
  color: var(--slate-400);
}

.prompt-bottom-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
}

/* Screen-Reader Only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Studio Mode Dropdown (Dropdown Width Strictly Equal to Parent) */
.studio-mode-dropdown-wrap {
  position: relative;
  display: inline-flex;
}

.studio-mode-pill {
  width: 100%;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 9999px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.studio-mode-pill:hover,
.studio-mode-pill.active {
  border-color: #059669;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.12);
}

.studio-mode-icon {
  color: #059669;
  flex-shrink: 0;
}

/* Mode text made small and clean */
.studio-mode-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-500);
  letter-spacing: 0.01em;
  line-height: 1;
}

.studio-mode-current {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-800);
  line-height: 1;
}

.studio-mode-chevron {
  color: var(--slate-400);
  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
  margin-left: 2px;
}

.studio-mode-pill:hover .studio-mode-chevron,
.studio-mode-pill.active .studio-mode-chevron {
  color: var(--slate-700);
}

.studio-mode-pill.active .studio-mode-chevron {
  transform: rotate(180deg);
}

/* Dropdown Menu — Width is strictly equal to its parent (.studio-mode-dropdown-wrap) */
.studio-mode-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  box-shadow: 0 10px 20px -3px rgba(15, 23, 42, 0.12), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  padding: 3px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: studioModeMenuIn 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes studioModeMenuIn {
  from {
    opacity: 0;
    transform: translateY(-3px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.studio-mode-menu-item {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-700);
  transition: all 0.12s ease;
  text-align: left;
}

.studio-mode-menu-item:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.studio-mode-menu-item.selected {
  background: #ecfdf5;
  color: #059669;
  font-weight: 600;
}

.studio-mode-menu-item .mode-check-icon {
  color: #059669;
  flex-shrink: 0;
}


/* Studio Interactive Chat Panel */
.studio-chat-panel {
  margin-top: 14px;
  margin-bottom: 20px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition: all 0.2s ease;
}

.studio-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  font-size: 13px;
  color: var(--slate-800);
}

.studio-chat-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.chat-model-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: 9999px;
  padding: 2px 8px;
}

.chat-action-btn {
  background: transparent;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--slate-600);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-action-btn:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.studio-chat-messages {
  max-height: 460px;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #ffffff;
}

.chat-msg-row {
  display: flex;
  flex-direction: column;
  width: 100%;
}

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

.chat-msg-row.assistant {
  align-items: flex-start;
}

.chat-bubble-user {
  max-width: 80%;
  background: var(--brand-600);
  color: #ffffff;
  border-radius: 14px 14px 2px 14px;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.2);
}

.chat-bubble-assistant {
  max-width: 90%;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 14px 14px 14px 2px;
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--slate-800);
  line-height: 1.55;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.chat-intent-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: 6px;
  padding: 3px 8px;
  margin-bottom: 10px;
}

.chat-content-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-content-body p {
  margin-top: 0;
  margin-bottom: 8px;
}

.chat-content-body p:last-child {
  margin-bottom: 0;
}

.chat-workflow-card {
  margin-top: 14px;
  border: 1px solid var(--brand-200);
  background: #f8faff;
  border-radius: 8px;
  padding: 12px 14px;
}

.chat-workflow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.chat-workflow-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--slate-900);
}

.chat-workflow-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.chat-workflow-step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

.chat-step-num {
  font-weight: 700;
  color: var(--brand-600);
  font-size: 11px;
  min-width: 16px;
}

.chat-step-name {
  font-weight: 600;
  color: var(--slate-800);
}

.chat-step-agent {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate-500);
  background: var(--slate-100);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: auto;
}

.btn-generate-from-chat {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  transition: all 0.15s ease;
}

.btn-generate-from-chat:hover {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  transform: translateY(-1px);
  box-shadow: 0 4px 8px -1px rgba(99, 102, 241, 0.25);
}

.chat-thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--slate-500);
  font-style: italic;
  padding: 8px 12px;
  background: var(--slate-100);
  border-radius: 8px;
}

.chat-dots {
  display: inline-flex;
  gap: 3px;
}

.chat-dot {
  width: 5px;
  height: 5px;
  background-color: var(--slate-500);
  border-radius: 50%;
  animation: chatDotBlink 1.4s infinite both;
}

.chat-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatDotBlink {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

.engine-ready-indicator {
  font-size: 12px;
  color: var(--slate-400);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.prompt-action-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.prompt-icon-btn {
  padding: 8px;
  border-radius: var(--radius-full);
  color: var(--slate-400);
  transition: all 0.15s;
}

.prompt-icon-btn:hover {
  color: var(--slate-600);
  background-color: var(--slate-100);
}

.prompt-submit-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--brand-600);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.prompt-submit-btn:hover {
  background-color: var(--brand-500);
  transform: scale(1.05);
}

.prompt-submit-btn:active {
  transform: scale(0.96);
}

/* Suggestion Pills */
.suggestion-pills-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.suggestion-pill {
  padding: 8px 16px;
  background-color: var(--slate-50);
  border: 1px solid var(--slate-200);
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-700);
  border-radius: var(--radius-full);
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.suggestion-pill:hover {
  background-color: var(--slate-100);
  border-color: var(--slate-300);
  color: var(--slate-900);
}

.refresh-suggestions-btn {
  padding: 8px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-full);
  color: var(--slate-400);
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.refresh-suggestions-btn:hover {
  color: var(--slate-600);
  background-color: var(--slate-50);
}

/* Recent Projects Section */
.recent-projects-section {
  margin-top: 56px;
}

.recent-projects-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .recent-projects-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.recent-projects-title h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--slate-900);
}

.recent-projects-title p {
  color: var(--slate-500);
  font-size: 13px;
  margin-top: 2px;
}

.recent-projects-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.select-all-checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-700);
  cursor: pointer;
  user-select: none;
}

.select-all-checkbox-wrap input {
  accent-color: var(--brand-600, #059669);
  cursor: pointer;
}

.filter-select-btn {
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-700);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s;
}

.filter-select-btn:hover {
  background-color: var(--slate-50);
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap svg,
.search-input-wrap i {
  position: absolute;
  left: 10px;
  top: 9px;
  color: var(--slate-400);
  width: 14px;
  height: 14px;
}

.search-input-box {
  padding: 6px 12px 6px 32px;
  font-size: 12px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  outline: none;
  width: 280px;
  transition: all 0.15s;
}

.search-input-box:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 1px var(--brand-500);
}

.dropdown-wrap {
  position: relative;
}

.filter-dropdown-select {
  appearance: none;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 6px 30px 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-700);
  cursor: pointer;
  outline: none;
}

.filter-dropdown-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 1px var(--brand-500);
}

.dropdown-arrow-icon {
  position: absolute;
  right: 10px;
  top: 9px;
  pointer-events: none;
  color: var(--slate-400);
}

.view-all-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-600);
  margin-left: 4px;
}

.view-all-link:hover {
  color: var(--brand-700);
  text-decoration: underline;
}

.view-all-below-wrap {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.btn-danger-action {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-danger-action:hover {
  background: rgba(220, 38, 38, 0.16);
}

/* Projects Grid */
.projects-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .projects-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .projects-cards-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Create New Card (Dashed) */
.create-new-card {
  border: 2px dashed var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  background-color: rgba(248, 250, 252, 0.6);
  min-height: 175px;
  transition: all 0.2s ease;
}

.create-new-card:hover {
  border-color: var(--brand-400);
  background-color: rgba(236, 253, 245, 0.25);
}

.create-new-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-500);
  margin-bottom: 12px;
  transition: all 0.2s;
}

.create-new-card:hover .create-new-icon-circle {
  border-color: var(--brand-300);
  color: var(--brand-600);
  transform: scale(1.08);
}

.create-new-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-800);
  transition: color 0.15s;
}

.create-new-card:hover .create-new-title {
  color: var(--brand-700);
}

.create-new-subtext {
  font-size: 12px;
  color: var(--slate-400);
  margin-top: 2px;
}

/* Project Card */
.project-card {
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 175px;
  transition: all 0.2s ease;
}

.project-card-description {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.project-card-checkbox {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand-600, #059669);
}

.project-card.select-mode {
  cursor: default;
}

.project-card.card-selected {
  border-color: var(--brand-400, #34d399);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.25);
}

.project-card:hover {
  border-color: var(--slate-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.project-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-800);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.project-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background-color: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid rgba(167, 243, 208, 0.8);
  margin-top: 10px;
}

.project-card-footer {
  padding-top: 14px;
  border-top: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--slate-400);
}

.project-card-edit-btn {
  font-weight: 500;
  color: var(--brand-600);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}

.project-card-edit-btn:hover {
  color: var(--brand-700);
}

.project-card-edit-btn span {
  transition: transform 0.15s;
}

.project-card-edit-btn:hover span {
  transform: translateX(2px);
}



/* --------------------------------------------------------------------------
   CANVAS & EXECUTION SCREEN (SCREEN 2)
   -------------------------------------------------------------------------- */
.canvas-body {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #ffffff;
  color: var(--slate-800);
  font-family: var(--font-sans);
}

/* Top Navigation Bar */
.canvas-top-nav {
  height: 56px;
  border-bottom: 1px solid var(--slate-200);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 30;
  flex-shrink: 0;
}

.nav-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-to-dashboard-btn {
  padding: 6px;
  color: var(--slate-400);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.back-to-dashboard-btn:hover {
  color: var(--slate-600);
  background-color: var(--slate-100);
}

.brand-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background-color: var(--brand-600);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.nav-divider-pipe {
  height: 16px;
  width: 1px;
  background-color: var(--slate-200);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Prompt in Full Width Line with Click-to-View Disclosure */
.canvas-prompt-header-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px;
  position: relative;
}

.canvas-prompt-line-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--slate-800);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.canvas-prompt-line-text:hover {
  background-color: var(--slate-100);
  color: var(--slate-900);
}

.btn-prompt-info {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--slate-200);
  background: #ffffff;
  color: var(--slate-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-prompt-info:hover {
  background: var(--slate-100);
  color: #059669;
  border-color: #a7f3d0;
}

.prompt-info-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Full Prompt Disclosure Popover (Anchored directly under the i icon on the right) */
.full-prompt-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: 520px;
  max-width: min(520px, calc(100vw - 32px));
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  box-shadow: 0 16px 32px -4px rgba(15, 23, 42, 0.15), 0 6px 12px -2px rgba(15, 23, 42, 0.06);
  padding: 12px 14px;
  z-index: 1050;
  animation: userPopoverIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.full-prompt-popover::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 8px;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-top: 1px solid var(--slate-200);
  border-left: 1px solid var(--slate-200);
  transform: rotate(45deg);
}

.full-prompt-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--slate-100);
}

.full-prompt-popover-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--slate-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.full-prompt-close-btn {
  background: transparent;
  border: none;
  color: var(--slate-400);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.full-prompt-close-btn:hover {
  color: var(--slate-700);
  background: var(--slate-100);
}

.full-prompt-content {
  max-height: 240px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
  color: var(--slate-700);
  background: var(--slate-50);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--slate-200);
  margin: 10px 0;
  word-break: break-word;
  white-space: pre-wrap;
  font-family: inherit;
}

.full-prompt-footer {
  display: flex;
  justify-content: flex-end;
}

.btn-copy-prompt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-700);
  background: #ffffff;
  border: 1px solid var(--slate-200);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy-prompt:hover {
  background: var(--slate-50);
  color: #059669;
  border-color: #a7f3d0;
}

.nav-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Header Tab Group (Visual Editor & Execution Live on Left of Run button) */
.canvas-header-tab-group {
  display: inline-flex;
  align-items: center;
  background: var(--slate-100);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--slate-200);
  gap: 2px;
}

.canvas-header-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-600);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.canvas-header-tab:hover {
  color: var(--slate-900);
}

.canvas-header-tab.active {
  background: #ffffff;
  color: #059669;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.canvas-header-tab .live-pill-tag {
  margin-left: 4px;
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: 9999px;
  padding: 1px 5px;
  font-size: 9.5px;
  font-weight: 600;
}

.run-studio-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #059669;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
  transition: all 0.15s ease;
  border: none;
  cursor: pointer;
}

.run-studio-btn:hover {
  background-color: #047857;
}

.run-studio-btn:active {
  transform: scale(0.96);
}

/* Floating Round Run FAB — absolute bottom-right, offset when resources drawer is open */
.canvas-run-fab {
  position: absolute;
  bottom: 24px;
  right: calc(var(--resources-width) + 24px);
  z-index: 80;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: #059669;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.45), 0 2px 6px rgba(5, 150, 105, 0.25);
  transition: right 0.24s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.canvas-run-fab::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.35);
  animation: fab-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes fab-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 0;   transform: scale(1.28); }
}

.canvas-run-fab:hover {
  background-color: #047857;
  transform: scale(1.07);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.55), 0 2px 8px rgba(5, 150, 105, 0.3);
}

.canvas-run-fab:active {
  transform: scale(0.94);
}

.canvas-run-fab svg {
  /* nudge play icon slightly right to visually center it */
  transform: translateX(1px);
}

/* Canvas Header User Profile & Options Popover */
.canvas-user-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.canvas-user-avatar-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.canvas-user-avatar-btn:hover {
  transform: scale(1.05);
}

.canvas-user-avatar-btn:focus-visible,
.canvas-user-avatar-btn.active {
  box-shadow: 0 0 0 2px #0ea572;
}

.canvas-user-options-popover {
  position: absolute;
  top: calc(100% + 10px) !important;
  right: 0 !important;
  left: auto !important;
  bottom: auto !important;
  width: 250px !important;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.14), 0 6px 16px -2px rgba(15, 23, 42, 0.06);
  padding: 6px 0;
  z-index: 1100;
  animation: userPopoverIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.canvas-user-options-popover::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 11px;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-top: 1px solid var(--slate-200);
  border-left: 1px solid var(--slate-200);
  transform: rotate(45deg);
}

/* Left Copilot Panel (Absolute High Z-Indexed Overlay Drawer) */
.copilot-sidebar-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--copilot-width);
  height: 100%;
  z-index: 70;
  border-right: 1px solid var(--slate-200);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: visible;
  box-shadow: 6px 0 24px rgba(15, 23, 42, 0.09);
  transform: translateX(0);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.copilot-sidebar-panel.collapsed {
  transform: translateX(-100%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.copilot-header {
  padding: 12px;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.copilot-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copilot-icon-box {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background-color: var(--brand-50);
  border: 1px solid var(--brand-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-600);
}

.copilot-header-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-800);
}

.copilot-stream-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 12px;
}

.copilot-message-bubble {
  background-color: var(--slate-50);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-lg);
  padding: 14px;
  color: var(--slate-700);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.copilot-status-line {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 10px;
  margin-bottom: 0;
  font-size: 11px;
  color: var(--slate-500);
  animation: status-line-in 0.25s ease-out;
}

.copilot-status-line svg {
  flex-shrink: 0;
  color: var(--slate-400);
}

.copilot-status-line.plain {
  font-weight: 600;
  color: var(--slate-700);
}

.copilot-status-line .csl-icon {
  width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.copilot-status-line.pending .csl-text {
  color: var(--slate-600);
}

@keyframes status-line-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.copilot-subpoints {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 8px;
  border-left: 2px solid var(--brand-500);
  color: var(--slate-600);
}

.copilot-subpoints strong {
  color: var(--slate-800);
}

.copilot-question-card {
  background-color: rgba(236, 253, 245, 0.4);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.copilot-question-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-700);
  font-weight: 600;
}

.copilot-run-btn {
  width: 100%;
  background-color: var(--slate-900);
  color: #ffffff;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.15s;
  box-shadow: var(--shadow-xs);
}

.copilot-run-btn:hover {
  background-color: var(--slate-800);
}

.copilot-dismiss-btn {
  font-size: 11px;
  color: var(--slate-400);
  text-align: center;
  cursor: pointer;
  transition: color 0.15s;
}

.copilot-dismiss-btn:hover {
  color: var(--slate-600);
}

.copilot-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--slate-400);
  padding-top: 4px;
}

.ping-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--brand-500);
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.copilot-input-bar {
  padding: 12px;
  border-top: 1px solid var(--slate-200);
  background: #ffffff;
}

.copilot-textarea-box {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s;
}

.copilot-textarea-box:focus-within {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 1px var(--brand-500);
}

.copilot-chat-textarea {
  width: 100%;
  font-size: 12px;
  color: var(--slate-800);
  resize: none;
  border: none;
  outline: none;
  padding: 0;
  min-height: 48px;
}

.copilot-chat-textarea::placeholder {
  color: var(--slate-400);
}

.copilot-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--slate-100);
}

.copilot-tool-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--slate-400);
}

.copilot-tool-btn {
  padding: 4px;
  color: var(--slate-400);
  border-radius: 4px;
  transition: color 0.15s;
}

.copilot-tool-btn:hover {
  color: var(--slate-600);
}

.copilot-send-btn {
  background-color: var(--slate-900);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}

.copilot-send-btn:hover {
  background-color: var(--slate-800);
}

/* Full Screen Canvas Main Area */
.canvas-main-area {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--slate-50);
}

/* Canvas Dot Grid — Edge-to-Edge Full Screen Background & Viewport */
.canvas-dot-grid {
  background-color: #f8fafc;
  background-image: radial-gradient(#cbd5e1 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  user-select: none;
}

.canvas-dot-grid:active {
  cursor: grabbing;
}

/* canvas-node: absolutely positioned inside #canvas-viewport */
.canvas-node {
  position: absolute !important;
  cursor: move;
}

.canvas-node.is-dragging {
  z-index: 100;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18), 0 4px 10px rgba(15, 23, 42, 0.1);
  opacity: 0.95;
}

.canvas-wire {
  transition: none;
}

.canvas-context-header {
  position: absolute;
  top: 16px;
  left: calc(var(--copilot-width) + 20px);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: left 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.canvas-main-area.copilot-collapsed .canvas-context-header,
.canvas-main-area:has(#copilot-sidebar.collapsed) .canvas-context-header,
.copilot-sidebar-panel.collapsed ~ #view-visual .canvas-context-header {
  left: 20px;
}

button.canvas-version-pill { cursor: pointer; font-family: inherit; }
button.canvas-version-pill:hover { color: var(--slate-800); border-color: var(--slate-300); }
.canvas-version-pill {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border: 1px solid var(--slate-200);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-600);
  box-shadow: var(--shadow-xs);
}

.canvas-icon-btn {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--slate-600);
  box-shadow: var(--shadow-xs);
  transition: all 0.15s;
}

.canvas-icon-btn:hover {
  background: var(--slate-50);
  color: var(--slate-800);
}

/* Node Graph Container */
.node-graph-container {
  position: relative;
  min-width: 1100px;
  min-height: 720px;
  padding: 40px 32px;
}

.svg-connector-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Nodes Rows */
.agent-nodes-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  position: relative;
  z-index: 10;
}

.task-nodes-row {
  margin-top: 112px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  position: relative;
  z-index: 10;
}

/* ==========================================================================
   STITCH FEDERIS AGENTIC STUDIO CANVAS NODES (matching code.html exactly)
   ========================================================================== */

/* Wires: SVG curves connecting nodes */
.canvas-wire {
  fill: none;
  transition: stroke 0.15s ease, stroke-width 0.15s ease;
}

.canvas-wire.dashed {
  stroke-dasharray: 4, 4;
}

.canvas-wire.animate-pulse {
  animation: wirePulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes wirePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Agent Node Box */
.canvas-node.node-agent-box {
  position: absolute !important;
  width: 235px;
  background-color: #ffffff;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
  cursor: move;
  z-index: 5;
  box-sizing: border-box;
}

.canvas-node.node-agent-box:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

.canvas-node.node-agent-box.active-node {
  border: 2px solid rgba(16, 185, 129, 0.85) !important;
}

/* Missing provider API key indicator */
.canvas-node.node-agent-box.agent-key-missing {
  border: 1.5px solid #fca5a5 !important;
}

.agent-box-key-missing-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  border: 1.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  cursor: help;
  z-index: 6;
}

.agent-box-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.agent-box-title-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.agent-box-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background-color: #f1f5f9;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.agent-box-icon.active {
  background-color: #ecfdf5;
  color: #059669;
}

.agent-box-title {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  white-space: normal;
}

.agent-box-desc {
  font-size: 11px;
  color: #64748b;
  margin: 8px 0 0 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.agent-box-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.agent-box-model-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: #f1f5f9;
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 500;
}

.agent-box-tool-icon {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.agent-box-tool-icon.active {
  color: #059669;
}

.agent-box-edit-btn {
  background: none;
  border: none;
  padding: 2px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s, background-color 0.15s;
}

.agent-box-edit-btn:hover {
  color: #059669;
  background-color: #f1f5f9;
}

.agent-box-edit-btn svg {
  width: 14px;
  height: 14px;
}

.agent-box-connector-dot {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background-color: #ffffff;
  border: 2px solid #94a3b8;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.agent-box-connector-dot.active {
  border-color: #059669;
}

.agent-box-connector-inner {
  width: 6px;
  height: 6px;
  background-color: #475569;
  border-radius: 9999px;
}

.agent-box-connector-dot.active .agent-box-connector-inner {
  background-color: #059669;
}

/* Task Node Box */
.canvas-node.node-task-box {
  position: absolute !important;
  width: 240px;
  background-color: #ffffff;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  user-select: none;
  cursor: move;
  z-index: 5;
  box-sizing: border-box;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.canvas-node.node-task-box:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  z-index: 10;
}

.canvas-node.node-task-box.active-node {
  border: 1px solid #6ee7b7 !important;
}

.task-box-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #334155;
}

.task-box-header.active {
  color: #059669;
}

.task-box-header svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.task-box-title {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  white-space: normal;
  flex: 1;
  min-width: 0;
}

.task-box-desc {
  font-size: 11px;
  color: #64748b;
  margin: 6px 0 0 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-box-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: #94a3b8;
}

.task-box-tag {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  color: #64748b;
  font-weight: 500;
}

.task-box-edit-btn {
  background: none;
  border: none;
  padding: 2px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s, background-color 0.15s;
}

.task-box-edit-btn:hover {
  color: #475569;
  background-color: #f1f5f9;
}

/* Task Connector Dots */
.task-dot-top {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background-color: #10b981;
  border: 2px solid #ffffff;
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.task-dot-left {
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background-color: #94a3b8;
  border: 2px solid #ffffff;
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.task-dot-left.active {
  background-color: #10b981;
}

.task-dot-right {
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background-color: #10b981;
  border: 2px solid #ffffff;
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.task-dot-bottom {
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background-color: #10b981;
  border: 2px solid #ffffff;
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

/* Fallback Node Cards */
.node-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 14px;
  position: absolute !important;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
  user-select: none;
}

.node-action-icon {
  color: #64748b;
  padding: 3px 5px;
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.node-action-icon:hover {
  color: #2563eb;
  background: #eff6ff;
}

.node-action-icon.danger:hover {
  color: #ef4444;
  background: #fef2f2;
}

.node-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.node-title-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.node-icon-box {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background-color: var(--slate-100);
  color: var(--slate-700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.node-icon-box.brand-box {
  background-color: #eff6ff;
  color: #2563eb;
}

.node-icon-box.purple-box {
  background-color: #eef2ff;
  color: #4f46e5;
}

.node-title-text {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.25;
}

.node-title-text.purple {
  color: #4338ca;
  font-size: 12.5px;
}

.node-subtitle-text {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.node-model-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: #334155;
  margin: 6px 0 2px 0;
}

.node-description {
  font-size: 11px;
  color: #64748b;
  margin-top: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.model-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background-color: var(--slate-100);
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.task-tag {
  background-color: var(--slate-50);
  border: 1px solid var(--slate-200);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  color: var(--slate-400);
}

/* Connector Dots */
.connector-dot-output-bottom {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: #ffffff;
  border: 2px solid var(--slate-400);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.connector-dot-output-bottom.brand {
  border-color: var(--brand-600);
}

.connector-dot-output-bottom .dot-inner {
  width: 6px;
  height: 6px;
  background: var(--slate-600);
  border-radius: var(--radius-full);
}

.connector-dot-output-bottom.brand .dot-inner {
  background: var(--brand-600);
}

.connector-dot-input-top {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: var(--brand-500);
  border: 2px solid #ffffff;
  border-radius: var(--radius-full);
}

.connector-dot-input-left {
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: var(--slate-400);
  border: 2px solid #ffffff;
  border-radius: var(--radius-full);
}

.connector-dot-output-right {
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: var(--brand-500);
  border: 2px solid #ffffff;
  border-radius: var(--radius-full);
}

/* Canvas Floating Controls */
.canvas-bottom-floating-controls {
  position: absolute;
  bottom: 24px;
  left: calc(var(--copilot-width) + 20px);
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 30;
  transition: left 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.canvas-main-area.copilot-collapsed .canvas-bottom-floating-controls,
.canvas-main-area:has(#copilot-sidebar.collapsed) .canvas-bottom-floating-controls,
.copilot-sidebar-panel.collapsed ~ #view-visual .canvas-bottom-floating-controls {
  left: 20px;
}

.canvas-footer-watermark {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--slate-400);
  font-family: var(--font-mono);
  user-select: none;
  pointer-events: none;
  z-index: 20;
  white-space: nowrap;
}

.canvas-main-area.resources-collapsed .canvas-run-fab,
.canvas-main-area:has(#resources-sidebar.collapsed) .canvas-run-fab {
  right: 24px;
}

/* Suggestion Pilot FAB — sits immediately left of the Run button */
.canvas-suggestion-fab {
  position: absolute;
  bottom: 24px;
  right: calc(var(--resources-width) + 24px + 52px + 12px);
  z-index: 80;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #ffffff;
  color: #6366f1;
  border: 1.5px solid #e0e7ff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: right 0.24s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.canvas-suggestion-fab:hover {
  background-color: #eef2ff;
  transform: scale(1.06);
}

.canvas-suggestion-fab:active {
  transform: scale(0.94);
}

.canvas-suggestion-fab .suggestion-fab-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f59e0b;
  border: 2px solid #ffffff;
  display: none;
}

.canvas-suggestion-fab.has-suggestions .suggestion-fab-badge {
  display: block;
}

.canvas-main-area.resources-collapsed .canvas-suggestion-fab,
.canvas-main-area:has(#resources-sidebar.collapsed) .canvas-suggestion-fab {
  right: calc(24px + 52px + 12px);
}

/* Suggestion Pilot popover panel */
.suggestion-pilot-panel {
  position: absolute;
  bottom: 78px;
  right: calc(var(--resources-width) + 24px);
  z-index: 90;
  width: 320px;
  max-height: 380px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 12px;
  display: none;
  transition: right 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.canvas-main-area.resources-collapsed .suggestion-pilot-panel,
.canvas-main-area:has(#resources-sidebar.collapsed) .suggestion-pilot-panel {
  right: 24px;
}

.suggestion-pilot-panel.open {
  display: block;
}

.suggestion-pilot-item {
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--slate-100);
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.suggestion-pilot-item:last-child {
  margin-bottom: 0;
}

.suggestion-pilot-item .suggestion-title {
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.suggestion-pilot-item.severity-warning .suggestion-title {
  color: #b45309;
}

.suggestion-pilot-item .suggestion-detail {
  color: var(--slate-500);
}

/* --------------------------------------------------------------------------
   EXECUTION TAB VIEW
   -------------------------------------------------------------------------- */
.execution-tab-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

.execution-header-bar {
  padding: 16px;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background-color: rgba(248, 250, 252, 0.5);
}

.execution-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.execution-header-title h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-800);
}

.execution-duration-text {
  font-size: 12px;
  color: var(--slate-500);
}

.execution-duration-text span {
  font-weight: 600;
  color: var(--slate-700);
  font-family: var(--font-mono);
}

.execution-split-grid {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 100%;
}

.execution-timeline-col {
  flex: 0 0 42%;
  width: 42%;
  min-width: 30%;
  max-width: 70%;
  border-right: none;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  background-color: #ffffff;
}

/* Split Resizer Divider Handle */
.execution-split-resizer {
  width: 9px;
  flex: 0 0 9px;
  cursor: col-resize;
  background-color: var(--slate-100);
  border-left: 1px solid var(--slate-200);
  border-right: 1px solid var(--slate-200);
  position: relative;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  z-index: 10;
}

.execution-split-resizer:hover,
.execution-split-resizer.is-dragging {
  background-color: #e0e7ff;
  border-color: #a5b4fc;
}

.split-resizer-handle {
  width: 3px;
  height: 32px;
  border-radius: 9999px;
  background-color: var(--slate-300);
  transition: background-color 0.15s ease, height 0.15s ease;
}

.execution-split-resizer:hover .split-resizer-handle,
.execution-split-resizer.is-dragging .split-resizer-handle {
  background-color: #6366f1;
  height: 44px;
}

.execution-timeline-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.execution-step-card {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 12px;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

/* Inline user-input / approval prompt, injected directly into the paused
   step's own Execution-view card — never the Copilot chat sidebar. */
.exec-inline-action-card {
  margin-top: 10px;
  max-width: 640px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.input-prompt-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.input-prompt-icon { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 8px; background: var(--brand-50, #f0fdf4); color: var(--brand-700, #047857); flex-shrink: 0; }
.input-prompt-icon svg { stroke: currentColor; }
.input-prompt-title { font-size: 14px; font-weight: 600; color: var(--slate-900); }
.input-prompt-sub { font-size: 12px; color: var(--slate-500); margin-top: 1px; }
.input-prompt-fields { display: flex; flex-direction: column; gap: 12px; }
.input-prompt-field { display: flex; flex-direction: column; gap: 4px; }
.input-prompt-label { font-size: 12.5px; font-weight: 500; color: var(--slate-700); display: flex; align-items: center; gap: 6px; }
.input-prompt-optional { font-size: 10.5px; font-weight: 500; color: var(--slate-500); background: var(--slate-100); border-radius: 999px; padding: 0 6px; }
.input-prompt-help { font-size: 11.5px; color: var(--slate-500); }
.input-prompt-control { font: inherit; font-size: 13.5px; line-height: 1.45; color: var(--slate-900); padding: 8px 11px; border: 1px solid var(--slate-300); border-radius: 8px; resize: none; overflow-y: auto; background: #fff; box-sizing: border-box; width: 100%; }
.input-prompt-control::placeholder { color: var(--slate-400); }
.input-prompt-control:focus { outline: none; border-color: var(--brand-500, #10b981); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }
.input-prompt-file { font-size: 12.5px; }
.input-prompt-error { color: #b91c1c; font-size: 12px; margin-top: 10px; }
.input-prompt-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.btn-submit-inputs { background: var(--brand-600, #059669); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-submit-inputs:hover:not(:disabled) { background: var(--brand-700, #047857); }
.btn-submit-inputs:disabled { opacity: .6; cursor: default; }
.input-prompt-hint { font-size: 11px; color: var(--slate-400); }

.exec-inline-action-card.severity-approval {
  background: #fff1f2;
  border-color: #f43f5e;
}

.step-card-agent-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--slate-800);
}

.step-card-agent-name svg,
.step-card-agent-name i {
  color: var(--brand-600);
}

.step-card-duration {
  font-size: 11px;
  color: var(--slate-400);
  font-family: var(--font-mono);
}

.step-card-subrow {
  padding-left: 20px;
  font-size: 12px;
  color: var(--slate-600);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--slate-50);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

.step-card-task-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-card-task-title svg,
.step-card-task-title i {
  color: var(--brand-500);
}

.step-done-badge {
  font-size: 10px;
  color: var(--brand-600);
  font-weight: 600;
}

/* Raw Output / Payload Inspector (Modern Clean Light Editor) */
.execution-payload-col {
  flex: 1 1 0;
  min-width: 30%;
  max-width: 70%;
  background-color: #f8fafc;
  color: var(--slate-800);
  overflow-y: auto;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.payload-inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--slate-200);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.payload-title-text {
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--slate-700);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.terminal-pill-btn {
  padding: 4px 10px;
  background-color: #ffffff;
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: all 0.15s ease;
}

.terminal-pill-btn:hover {
  background-color: var(--slate-100);
  color: var(--slate-900);
  border-color: var(--slate-300);
}

.payload-code-block {
  flex: 1;
  font-size: 12px;
  line-height: 1.65;
  color: #1e293b;
  background-color: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 16px;
  user-select: text;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* Syntax Highlighting for Payload JSON */
.payload-code-block .json-key {
  color: #4f46e5;
  font-weight: 600;
}

.payload-code-block .json-string {
  color: #059669;
}

.payload-code-block .json-number {
  color: #d97706;
}

.payload-code-block .json-boolean {
  color: #7c3aed;
  font-weight: 600;
}

.payload-code-block .json-null {
  color: #94a3b8;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   RIGHT SIDEBAR: RESOURCES & TOOLS (Absolute High Z-Indexed Overlay Drawer)
   -------------------------------------------------------------------------- */
.resources-sidebar-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: var(--resources-width);
  height: 100%;
  z-index: 70;
  border-left: 1px solid var(--slate-200);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: visible;
  box-shadow: -6px 0 24px rgba(15, 23, 42, 0.09);
  transform: translateX(0);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.resources-sidebar-panel.collapsed {
  transform: translateX(100%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Sidebar Edge Collapse Buttons (attached to middle of the side of each sidebar) */
.sidebar-edge-collapse-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  width: 22px;
  height: 48px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--slate-500);
  padding: 0;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-edge-collapse-btn:hover {
  background: #f8fafc;
  color: #059669;
  border-color: #a7f3d0;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

/* Copilot collapse button: attached on the right side of the Copilot sidebar (where it meets the canvas) */
.sidebar-edge-collapse-btn.right {
  right: -11px;
  border-radius: 6px;
}

.sidebar-edge-collapse-btn.right:hover {
  right: -13px;
  width: 25px;
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

/* Resources collapse button: attached on the left side of the Resources sidebar (where it meets the canvas) */
.sidebar-edge-collapse-btn.left {
  left: -11px;
  border-radius: 6px;
}

.sidebar-edge-collapse-btn.left:hover {
  left: -13px;
  width: 25px;
  background: #fff7ed;
  color: #ea580c;
  border-color: #fed7aa;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.2);
}

/* Edge Sidebar Expand Buttons (attached on the center of left/right screens when collapsed) */
.canvas-sidebar-edge-toggle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 54px;
  padding: 0;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Copilot Expand Button (Left): Light Green */
.canvas-sidebar-edge-toggle.left {
  left: 0;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-left: none;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.16);
}

.canvas-sidebar-edge-toggle.left:hover {
  width: 32px;
  background: #d1fae5;
  color: #047857;
  border-color: #6ee7b7;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.28);
}

/* Resources Expand Button (Right): Light Orange */
.canvas-sidebar-edge-toggle.right {
  right: 0;
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
  border-right: none;
  border-radius: 8px 0 0 8px;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.16);
}

.canvas-sidebar-edge-toggle.right:hover {
  width: 32px;
  background: #ffedd5;
  color: #c2410c;
  border-color: #fdba74;
  box-shadow: 0 4px 18px rgba(249, 115, 22, 0.28);
}

.resources-header {
  padding: 14px;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.resources-header h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-800);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.resources-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  overflow-y: auto;
}

.resource-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 10px;
}

.resource-draggables-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.draggable-component-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  background: #ffffff;
  cursor: grab;
  transition: all 0.15s ease;
}

.draggable-component-card:hover {
  border-color: var(--brand-500);
  box-shadow: var(--shadow-xs);
}

.draggable-component-card:active {
  cursor: grabbing;
}

.component-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.component-icon-box {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background-color: var(--brand-50);
  color: var(--brand-600);
  display: flex;
  align-items: center;
  justify-content: center;
}

.component-icon-box.slate-box {
  background-color: var(--slate-100);
  color: var(--slate-700);
}

.component-title-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-800);
}

.component-sub-text {
  font-size: 10px;
  color: var(--slate-400);
}

.tool-catalog-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.tool-catalog-search-wrap svg,
.tool-catalog-search-wrap i {
  position: absolute;
  left: 10px;
  top: 9px;
  color: var(--slate-400);
  width: 14px;
  height: 14px;
}

.tool-search-input {
  width: 100%;
  padding: 6px 28px 6px 32px;
  font-size: 12px;
  background-color: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.15s;
}

.tool-search-input:focus {
  background-color: #ffffff;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 1px var(--brand-500);
}

.tool-categories-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.category-accordion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border-radius: var(--radius-md);
  color: var(--slate-700);
  transition: background-color 0.15s;
}

.category-accordion-btn:hover {
  background-color: var(--slate-50);
}

.category-accordion-btn-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-accordion-btn-left svg,
.category-accordion-btn-left i {
  color: var(--slate-400);
  width: 14px;
  height: 14px;
}

.resources-quick-add-footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--slate-200);
  background-color: var(--slate-50);
  text-align: center;
}

.create-custom-tool-btn {
  width: 100%;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-700);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.create-custom-tool-btn:hover {
  border-color: var(--brand-500);
  color: var(--brand-600);
}

/* --------------------------------------------------------------------------
   RESPONSIVE UTILITIES & ANIMATIONS
   -------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .agent-nodes-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .task-nodes-row {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-sidebar {
    display: none;
  }
  .resources-sidebar-panel {
    display: none;
  }
  .copilot-sidebar-panel {
    width: 100%;
  }
  .canvas-workspace-layout {
    flex-direction: column;
  }
}

/* --------------------------------------------------------------------------
   DASHBOARD TAB VIEWS (Studio, Agents, Tools, Execute, Monitor, Control,
   Templates, Env, Models, Explorer)
   -------------------------------------------------------------------------- */
.dashboard-tab-content {
  display: none;
  width: 100%;
  animation: fadeInTab 0.15s ease-out;
}

.dashboard-tab-content.active {
  display: block;
}

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

.tab-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.tab-header-title h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--slate-900);
}

.tab-header-title p {
  font-size: 13px;
  color: var(--slate-500);
  margin-top: 2px;
}

/* Cards & Panels */
.content-panel {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 24px;
}

.content-panel h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--slate-800);
  margin-bottom: 16px;
}

/* Form Styles */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-700);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--slate-800);
  outline: none;
  transition: all 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 1px var(--brand-500);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.btn-primary-action {
  background-color: var(--brand-600);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: background-color 0.15s;
}

.btn-primary-action:hover {
  background-color: var(--brand-700);
}

.btn-secondary-action {
  background-color: var(--slate-100);
  color: var(--slate-700);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  transition: all 0.15s;
}

.btn-secondary-action:hover {
  background-color: var(--slate-200);
  color: var(--slate-900);
}

/* Data Tables */
.data-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.data-table th {
  background-color: var(--slate-50);
  color: var(--slate-600);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--slate-200);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-800);
  vertical-align: top;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: var(--slate-50);
}

/* Agents Repository Table Specifics */
.agents-data-table {
  width: 100%;
}

.agent-name-label {
  font-weight: 600;
  color: var(--slate-900);
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  white-space: nowrap;
}

/* Tools Assigned Column: Wrap & Vertically Scrollable (Comfortably shows >= 3 rows) */
.agent-tools-scroll-wrap {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  max-height: 98px; /* comfortably displays at least 3 rows of tool pills */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 4px 2px 0;
}

.agent-tools-scroll-wrap::-webkit-scrollbar {
  width: 4px;
}
.agent-tools-scroll-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.agent-tools-scroll-wrap::-webkit-scrollbar-thumb {
  background: var(--slate-200);
  border-radius: 9999px;
}
.agent-tools-scroll-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--slate-300);
}

.agent-tool-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background-color: #f8fafc;
  border: 1px solid var(--slate-200);
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  color: #475569;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.02);
  transition: all 0.15s ease;
}

.agent-tool-pill:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* Status Badges */
.badge-ready {
  background-color: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid rgba(167, 243, 208, 0.8);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Templates Grid */
.templates-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.template-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  transition: all 0.2s ease;
}

.template-card:hover {
  border-color: var(--slate-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.template-category-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-700);
  background-color: var(--brand-50);
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 8px;
}

.template-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 6px;
}

.template-card-desc {
  font-size: 12px;
  color: var(--slate-500);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.template-card-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-600);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}

.template-card-btn:hover {
  color: var(--brand-700);
}

/* Password and Secret Inputs */
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap .form-input {
  padding-right: 36px;
}

.password-eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s;
}

.password-eye-btn:hover {
  color: var(--slate-700);
}

/* Monospace textareas */
.mono-textarea {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  background-color: #f8fafc;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  width: 100%;
  min-height: 140px;
  box-sizing: border-box;
  color: var(--slate-800);
  outline: none;
  resize: vertical;
}

.mono-textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 1px var(--brand-500);
}

/* Notification & Toast */
.toast-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-left: 4px solid var(--brand-500);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  box-shadow: var(--shadow-xl);
  font-size: 13px;
  color: var(--slate-800);
  animation: slideInUp 0.2s ease;
}

.toast-banner.error {
  border-left-color: var(--danger-500);
}

.toast-banner.success {
  border-left-color: var(--brand-500);
}

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

/* Empty State Card */
.empty-projects-state {
  border: 1px dashed var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  text-align: center;
  background-color: var(--slate-50);
  color: var(--slate-500);
  grid-column: 1 / -1;
}

.empty-projects-beside-card {
  grid-column: 2 / -1;
  border: 2px dashed var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: rgba(248, 250, 252, 0.4);
  min-height: 175px;
  transition: border-color 0.2s;
}

@media (max-width: 639px) {
  .empty-projects-beside-card {
    grid-column: 1 / -1;
  }
}

.projects-cards-grid > .empty-projects-beside-card:first-child {
  grid-column: 1 / -1;
}

.empty-projects-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 6px;
}

.empty-projects-subtext {
  font-size: 12px;
  color: var(--slate-400);
  max-width: 360px;
  margin: 0 auto 12px auto;
  line-height: 1.4;
}

.empty-projects-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Model Connections — Provider Table & Accordion Details
   ========================================================================== */

.provider-row {
  transition: background-color 0.15s ease;
}

.provider-row:hover td {
  background-color: #f8fafc;
}

.provider-name-cell {
  vertical-align: middle !important;
}

.provider-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--slate-900);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}

.provider-toggle-btn:hover {
  color: var(--brand-600);
  background: var(--slate-100);
}

.provider-chevron {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--slate-400);
  flex-shrink: 0;
}

.provider-chevron.expanded {
  transform: rotate(90deg);
  color: var(--brand-600);
}

.provider-name-title {
  font-weight: 600;
  color: var(--slate-900);
}

/* Accordion expanded sub-row */
.provider-models-row td {
  padding: 0 !important;
  background-color: #fbfcfd;
  border-bottom: 1px solid var(--slate-200);
}

.provider-models-panel {
  padding: 14px 20px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-top: 1px dashed var(--slate-200);
  border-bottom: 1px solid var(--slate-200);
}

.provider-models-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.provider-model-filter {
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--slate-800);
  outline: none;
  min-width: 140px;
}

.provider-model-filter:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 1px var(--brand-500);
}

.provider-models-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 130px;
  overflow-y: auto;
  padding: 2px 2px 4px 0;
}

.provider-model-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 11px;
  color: var(--slate-700);
  font-family: var(--font-mono, monospace);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.provider-model-chip:hover {
  background: var(--brand-50);
  border-color: var(--brand-300);
  color: var(--brand-700);
}

.provider-model-chip.is-default {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
  font-weight: 600;
}

.provider-model-chip .default-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  background: #059669;
  color: #ffffff;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.provider-model-chip .free-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  background: #3b82f6;
  color: #ffffff;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.provider-models-empty,
.provider-models-error,
.provider-models-loading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px;
  flex-wrap: wrap;
}

@keyframes spin-anim {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-icon {
  animation: spin-anim 0.8s linear infinite;
}

/* 3-Column Flexible Grid for Configure Model Form */
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* Checkmarkable Models List */
.provider-models-check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px 2px;
}

.model-check-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 12px;
  color: var(--slate-700);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.model-check-card:hover {
  border-color: var(--brand-300);
  background: var(--slate-50);
}

.model-check-card.is-selected {
  background: #ecfdf5;
  border-color: var(--brand-500);
  color: var(--brand-900);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.12);
}

.model-radio-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.model-check-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--slate-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: transparent;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.model-check-card:hover .model-check-box {
  border-color: var(--brand-400);
}

.model-check-card.is-selected .model-check-box {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #ffffff;
}

.model-check-box .check-icon {
  width: 11px;
  height: 11px;
}

.model-check-label code {
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   INTERACTIVE SIDEBAR COMPONENTS & REAL TOOL CATALOG
   -------------------------------------------------------------------------- */

/* Component Add Button (+) on Swarm Cards */
.component-add-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.component-add-btn:hover {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #ffffff;
  transform: scale(1.1);
}

/* Tool Accordion Category Header */
.category-accordion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--slate-700);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.category-accordion-btn:hover {
  background-color: var(--slate-100);
  color: var(--slate-900);
}

.category-accordion-btn.is-open {
  background-color: var(--slate-50);
  border-color: var(--slate-200);
  color: var(--slate-900);
}

.category-accordion-btn.is-open .category-chevron {
  transform: rotate(90deg);
}

.category-chevron {
  transition: transform 0.2s ease;
}

.category-count-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--slate-200);
  color: var(--slate-600);
}

/* Tool List Items inside Category */
.category-tools-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 4px 10px 14px;
}

.tool-item-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-item-card:hover {
  border-color: var(--brand-400);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.tool-item-icon {
  font-size: 14px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--slate-50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--slate-100);
}

.tool-item-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--slate-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.tool-item-desc {
  font-size: 10.5px;
  color: var(--slate-400);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Canvas Drop Highlight */
#view-visual.drag-over {
  outline: 2px dashed #059669 !important;
  outline-offset: -4px;
  background-color: rgba(236, 253, 245, 0.4) !important;
}

/* AI Assist Prompts Popover */
.copilot-ai-popover {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.15);
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  animation: userPopoverIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.copilot-ai-popover-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-400);
  margin-bottom: 3px;
  padding: 0 4px;
}

.copilot-ai-prompt-chip {
  text-align: left;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--slate-700);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.copilot-ai-prompt-chip:hover {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

/* Attached Context File Chips */
.copilot-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--slate-700);
}

.copilot-file-chip-remove {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--slate-400);
  padding: 0;
  display: inline-flex;
  font-size: 12px;
  line-height: 1;
}

.copilot-file-chip-remove:hover {
  color: #ef4444;
}

/* Voice Button Listening Pulse */
.copilot-tool-btn.listening {
  color: #ef4444 !important;
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  animation: voice-pulse 1.2s ease-in-out infinite;
}

@keyframes voice-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

/* Thinking Indicator Bubble */
.copilot-thinking-bubble {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--slate-500);
  animation: pulse 1.5s ease-in-out infinite;
}

.copilot-thinking-dots {
  display: inline-flex;
  gap: 3px;
}

.copilot-thinking-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand-500);
  animation: dot-bounce 1.4s infinite ease-in-out both;
}

.copilot-thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.copilot-thinking-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.copilot-apply-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #059669;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.15s ease;
}

.copilot-apply-btn:hover {
  background: #047857;
  transform: translateY(-1px);
}

/* --- Agentic Copilot Interactive Question & Wireframe Styles --- */
.copilot-clarifying-card {
  margin-top: 10px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.copilot-q-meta {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate-400);
}

.copilot-q-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-900);
  line-height: 1.45;
  text-wrap: balance;
}

.copilot-q-why {
  font-size: 11.5px;
  color: var(--slate-500);
  line-height: 1.45;
}

.copilot-q-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.copilot-option-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 12px;
  color: var(--slate-700);
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
  text-align: left;
  line-height: 1.35;
}

.copilot-option-pill:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
}

.copilot-option-pill.active {
  background: var(--brand-50);
  border-color: var(--brand-600);
  color: var(--slate-900);
  font-weight: 600;
}

.copilot-option-tag {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--slate-400);
}

.copilot-option-check {
  flex-shrink: 0;
  color: var(--brand-600);
}

.copilot-q-hint {
  font-size: 11px;
  color: var(--slate-400);
}

.copilot-wireframe-container {
  margin-top: 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.copilot-wf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.copilot-wf-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.copilot-wf-meta-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.copilot-wf-meta-row {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.4;
}

.copilot-wf-meta-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}

.copilot-wf-meta-val {
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
  text-align: right;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.copilot-node-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.copilot-node-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.copilot-node-item:not(:last-child)::after {
  content: "↓";
  position: absolute;
  bottom: -13px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #94a3b8;
  font-weight: bold;
  z-index: 1;
}

.copilot-node-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.copilot-node-name {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.copilot-node-role {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}

.copilot-node-badges {
  display: flex;
  gap: 4px;
  align-items: center;
}

.copilot-tool-tag {
  background: #eff6ff;
  color: #2563eb;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.copilot-gate-tag {
  background: #fef3c7;
  color: #b45309;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

.copilot-approve-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.copilot-approve-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.copilot-trace-expander {
  font-size: 11px;
  color: #64748b;
  margin-top: 6px;
  cursor: pointer;
}

.copilot-trace-pill {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  margin-right: 4px;
  margin-bottom: 3px;
}

/* --- Internal Agent Status Progress Card --- */
.copilot-agent-status-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.copilot-agent-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--slate-100);
}

.copilot-agent-status-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--slate-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.copilot-agent-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #64748b;
  transition: all 0.2s ease;
}

.copilot-agent-status-badge.processing {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
}

.copilot-agent-status-badge.completed {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.copilot-agent-status-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.copilot-status-step {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--slate-400);
  transition: all 0.2s ease;
}

.copilot-status-step.active {
  color: var(--slate-800);
  font-weight: 600;
}

.copilot-status-step.completed {
  color: var(--slate-700);
  font-weight: 500;
}

.status-step-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--slate-300);
}

.status-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: copilot-spin 0.65s linear infinite;
  display: inline-block;
}

@keyframes copilot-spin {
  to { transform: rotate(360deg); }
}

.status-check {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  animation: step-check-pop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes step-check-pop {
  0% { transform: scale(0.5); opacity: 0; }
  80% { transform: scale(1.18); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Sequential Internal-Agent Status Lines — minimal single-line ─────────── */
.copilot-agent-step-bubble {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  margin-bottom: 1px;
  animation: casb-slide-in 0.18s ease-out forwards;
  opacity: 0;
  transform: translateY(-2px);
}

@keyframes casb-slide-in {
  to { opacity: 1; transform: translateY(0); }
}

.casb-icon-wrap {
  width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.casb-task-text {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.copilot-agent-step-bubble.casb-done .casb-task-text {
  color: #64748b;
}

/* Intelligent Studio Execution States */
.canvas-node.running-node {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 8px 24px rgba(59, 130, 246, 0.2) !important;
  animation: node-pulse-blue 1.8s infinite ease-in-out;
}

@keyframes node-pulse-blue {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3), 0 4px 14px rgba(59, 130, 246, 0.15);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.45), 0 8px 26px rgba(59, 130, 246, 0.3);
  }
}

.canvas-node.node-completed {
  border-color: #10b981 !important;
}

.copilot-interactive-action-card {
  animation: slide-in-down 0.22s ease-out;
}

@keyframes slide-in-down {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   TRIGGERS CANVAS NODE (matching Screenshot 4.03.35 PM)
   ========================================================================== */
.canvas-node.node-trigger-card {
  position: absolute !important;
  width: 210px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  padding: 14px 14px 16px 14px;
  z-index: 20;
  user-select: none;
  cursor: grab;
  box-sizing: border-box;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.canvas-node.node-trigger-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
}

.canvas-node.node-trigger-card.active-node {
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18), 0 8px 24px -4px rgba(0, 0, 0, 0.08);
}

.trigger-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.trigger-card-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
}

.trigger-card-title-group {
  min-width: 0;
  flex: 1;
}

.trigger-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
}

.trigger-card-subtitle {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trigger-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.trigger-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.trigger-card-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.trigger-card-btn.active {
  background: #f5f3ff;
  border-color: #c084fc;
  color: #7e22ce;
}

.trigger-dot-right {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #a855f7;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #a855f7;
  z-index: 25;
}

/* Copilot Thought Process & Markdown Table Styles */
.copilot-thought-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin: 6px 0;
  overflow: hidden;
}

.copilot-thought-toggle {
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  user-select: none;
}

.copilot-thought-content {
  padding: 8px 10px;
  font-size: 11.5px;
  color: #475569;
  line-height: 1.5;
  border-top: 1px solid #e2e8f0;
}

.copilot-markdown-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 11.5px;
}

.copilot-markdown-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 600;
  padding: 6px 8px;
  text-align: left;
  border: 1px solid #e2e8f0;
}

.copilot-markdown-table td {
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.canvas-node.node-task-box.node-human-gate {
  border-left: 4px solid #ec4899 !important;
  box-shadow: 0 4px 16px -2px rgba(236, 72, 153, 0.15), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}

.starter-cue-box {
  transition: all 0.2s ease;
}

/* ==========================================================================
   Workflow-Aware Live Execution UI Styles
   ========================================================================== */

.execution-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.execution-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.exec-heading {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.exec-header-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
}

.exec-header-badge.status-running {
  background: #e0f2fe;
  color: #0369a1;
}

.exec-header-badge.status-completed {
  background: #dcfce7;
  color: #15803d;
}

.exec-header-badge.status-failed {
  background: #fee2e2;
  color: #b91c1c;
}

.exec-header-badge.status-paused {
  background: #fef3c7;
  color: #b45309;
}

.exec-header-badge.status-queued {
  background: #f1f5f9;
  color: #475569;
}

.exec-stats-group {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  color: #475569;
}

/* Execution Cards */
.exec-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  overflow: hidden;
}

.exec-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.08);
}

.exec-card.selected {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.exec-card.running-card {
  border-left: 4px solid #0284c7;
}

.exec-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  background: #fafafa;
  border-bottom: 1px solid transparent;
}

.exec-card.selected .exec-card-header {
  background: #f8fafc;
}

.exec-card-title-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.exec-status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.exec-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-agent { background: #e0e7ff; color: #4338ca; }
.tag-crew { background: #fdf2f8; color: #be185d; }
.tag-router { background: #fef3c7; color: #b45309; }
.tag-parallel { background: #ede9fe; color: #6d28d9; }
.tag-join { background: #e0f2fe; color: #0284c7; }
.tag-human { background: #fce7f3; color: #db2777; }
.tag-tool { background: #f1f5f9; color: #334155; }
.tag-mcp { background: #dcfce7; color: #15803d; }
.tag-transform { background: #ffedd5; color: #c2410c; }

.exec-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.exec-status-badge.badge-completed { background: #dcfce7; color: #15803d; }
.exec-status-badge.badge-running { background: #e0f2fe; color: #0284c7; }
.exec-status-badge.badge-waiting { background: #fef3c7; color: #b45309; }
.exec-status-badge.badge-failed { background: #fee2e2; color: #b91c1c; }
.exec-status-badge.badge-skipped { background: #f1f5f9; color: #64748b; }
.exec-status-badge.badge-pending { background: #f8fafc; color: #94a3b8; border: 1px solid #e2e8f0; }
.exec-status-badge.badge-retrying { background: #ffedd5; color: #c2410c; }

.exec-card-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exec-card-role {
  font-size: 12px;
  color: #64748b;
  font-weight: 400;
}

.exec-card-title-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exec-node-duration {
  font-size: 11px;
  color: #64748b;
  font-family: monospace;
}

.exec-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  padding: 2px;
}

.exec-card-body {
  padding: 12px 14px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.exec-sub-section {
  margin-top: 10px;
}

.exec-sub-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}

.exec-nested-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exec-nested-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
}

.exec-nested-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #1e293b;
}

.exec-nested-dur {
  margin-left: auto;
  font-size: 11px;
  color: #64748b;
  font-family: monospace;
}

.exec-nested-io {
  margin-top: 4px;
  font-size: 11.5px;
  color: #334155;
  word-break: break-all;
}

.exec-code-preview {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  max-height: 180px;
  overflow-y: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.exec-streamed-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: #166534;
  white-space: pre-wrap;
  max-height: 150px;
  overflow-y: auto;
}

.exec-error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  margin-top: 8px;
}

/* Branch Decisions */
.exec-branch-decisions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exec-branch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11.5px;
}

.exec-branch-row.matched {
  background: #ecfdf5;
  color: #065f46;
}

.exec-branch-row.unmatched {
  background: #f8fafc;
  color: #94a3b8;
}

/* Human Actions */
.exec-human-prompt-box {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
}

.exec-human-prompt-box p {
  margin: 4px 0 0 0;
  font-size: 12.5px;
  color: #92400e;
}

.exec-human-actions {
  display: flex;
  gap: 8px;
}

.exec-btn-approve {
  background: #16a34a;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.exec-btn-reject {
  background: #dc2626;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Inspector Tabs */
.exec-inspector-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.exec-inspector-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.tab-buttons {
  display: flex;
  gap: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px;
}

.tab-btn.active {
  background: #e2e8f0;
  color: #0f172a;
}

.format-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.switcher-label {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
}

.pill-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  color: #475569;
}

.pill-btn.active {
  background: var(--brand-600);
  color: #ffffff;
  border-color: var(--brand-600);
}

.exec-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #0284c7;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spin-icon {
  animation: spin 1s linear infinite;
}

/* Run Parameters Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.run-params-modal-dialog {
  background: #ffffff;
  border-radius: 10px;
  width: 480px;
  max-width: 90vw;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.modal-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.modal-dialog-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.modal-close-x {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
}

.modal-dialog-body {
  padding: 20px;
}

.modal-subtext {
  font-size: 12.5px;
  color: #64748b;
  margin: 0 0 16px 0;
}

.param-form-group {
  margin-bottom: 14px;
}

.param-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.type-pill {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #f1f5f9;
  color: #64748b;
  font-family: monospace;
}

.req-star {
  color: #dc2626;
}

.param-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

.param-input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.modal-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.btn-cancel {
  background: transparent;
  border: 1px solid #cbd5e1;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  color: #475569;
}

.btn-primary {
  background: var(--brand-600);
  color: #ffffff;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-700); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-primary:focus-visible, .btn-cancel:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.btn-cancel:hover { border-color: var(--slate-400); color: var(--slate-700); }


/* ---------- Run dialog: inputs + live preview ---------- */
.run-params-modal-dialog.run-params-wide { width: 960px; max-width: 94vw; }
.run-params-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; max-height: 64vh; overflow: hidden; }
.run-params-inputs, .run-params-preview { overflow-y: auto; min-height: 0; max-height: 64vh; padding-right: 4px; overscroll-behavior: contain; }
.run-params-section-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748b; margin-bottom: 10px; }
.run-input-row { display: flex; gap: 8px; align-items: flex-start; }
.run-input-row .param-input { resize: vertical; min-height: 38px; font-family: inherit; line-height: 1.45; }
.run-input-row .param-input:disabled { background: #f8fafc; color: #94a3b8; }
.run-input-attach { flex: 0 0 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #cbd5e1; border-radius: 6px; color: #475569; cursor: pointer; background: #fff; }
.run-input-attach:hover { border-color: var(--brand-500); color: var(--brand-700); }
.run-input-attach:focus-within { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }
.run-input-file-chip { margin-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: #0f172a; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; padding: 5px 8px; }
.run-input-file-chip[hidden], .run-params-error[hidden] { display: none; }
.run-input-remove { border: 0; background: transparent; font-size: 16px; line-height: 1; color: #64748b; cursor: pointer; }
.run-input-used { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.run-params-error { font-size: 12px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; padding: 8px 10px; }
.run-preview-step { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.run-preview-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #0f172a; margin-bottom: 6px; }
.run-preview-num { width: 20px; height: 20px; border-radius: 50%; background: var(--brand-600); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.run-preview-label { font-size: 11px; font-weight: 600; color: #64748b; margin: 6px 0 3px; }
.run-preview-text { font-size: 12.5px; line-height: 1.55; color: #334155; white-space: pre-wrap; word-break: break-word; }
mark.run-fill { background: var(--brand-50, #ecfdf5); color: var(--brand-800, #065f46); padding: 0 3px; border-radius: 3px; }
mark.run-missing { background: #fef3c7; color: #92400e; padding: 0 3px; border-radius: 3px; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) { .run-params-grid { grid-template-columns: 1fr; max-height: 70vh; overflow-y: auto; } }

/* ---------- Output rendering ---------- */
.exec-markdown-content { font-size: 13px; line-height: 1.65; color: #1e293b; overflow-wrap: anywhere; }
.exec-markdown-content h1, .exec-markdown-content h2, .exec-markdown-content h3 { line-height: 1.3; margin: 1em 0 .45em; color: #0f172a; }
.exec-markdown-content h1 { font-size: 18px; } .exec-markdown-content h2 { font-size: 16px; } .exec-markdown-content h3 { font-size: 14px; }
.exec-markdown-content p, .exec-markdown-content ul, .exec-markdown-content ol { margin: 0 0 .7em; }
.exec-markdown-content code { background: #f1f5f9; border-radius: 3px; padding: 1px 4px; font-size: 12px; }
.exec-markdown-content pre { background: #0f172a; color: #e2e8f0; padding: 10px 12px; border-radius: 6px; overflow-x: auto; }
.exec-markdown-content pre code { background: transparent; color: inherit; padding: 0; }
.exec-markdown-content table { border-collapse: collapse; display: block; overflow-x: auto; margin: 0 0 .8em; }
.exec-markdown-content th, .exec-markdown-content td { border: 1px solid #e2e8f0; padding: 5px 8px; text-align: left; font-size: 12.5px; }
.exec-markdown-content blockquote { border-left: 3px solid #cbd5e1; margin: 0 0 .7em; padding-left: 10px; color: #475569; }
.exec-raw-content, .exec-json-content { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #1e293b; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.exec-usage-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: #475569; margin-bottom: 12px; }
.exec-usage-row code { font-size: 11.5px; }
.exec-warning-box { font-size: 12.5px; line-height: 1.5; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.exec-tool-error { margin-top: 6px; font-size: 12px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 4px; padding: 6px 8px; white-space: pre-wrap; word-break: break-word; }
.exec-stat-error { color: #b91c1c; }
.exec-header-badge.status-warning { background: #fef3c7; color: #92400e; }
.exec-checks { margin-bottom: 12px; }
.exec-check-attempt { border: 1px solid #e2e8f0; border-radius: 6px; padding: 8px 10px; margin-top: 6px; font-size: 12px; }
.exec-check-attempt.failed { border-color: #fecaca; background: #fff7f7; }
.exec-check-attempt.passed { border-color: #bbf7d0; background: #f6fef9; }
.exec-check-head { font-weight: 600; color: #0f172a; margin-bottom: 4px; }
.exec-check-attempt ul { margin: 0; padding-left: 18px; }
.exec-check-attempt li.bad { color: #b91c1c; } .exec-check-attempt li.ok { color: #166534; } .exec-check-attempt li.unknown { color: #92400e; }
.exec-fullscreen-backdrop { position: fixed; inset: 0; z-index: 9999; background: rgba(15, 23, 42, .45); }
.exec-fullscreen { position: fixed; inset: 24px; z-index: 10000; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 25px 50px -12px rgba(15, 23, 42, .35); display: flex; flex-direction: column; }
.exec-fullscreen-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #e2e8f0; }
.exec-fullscreen-body { flex: 1; overflow: auto; padding: 20px 28px; }
.exec-fullscreen-body .exec-markdown-content { max-width: 78ch; font-size: 14px; }
.exec-fullscreen-body .exec-raw-content, .exec-fullscreen-body .exec-json-content { max-height: none; }

/* ---------- Trace timeline ---------- */
.trace-timeline { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.trace-row { display: grid; grid-template-columns: minmax(180px, 44%) 1fr; align-items: center; gap: 10px; padding: 5px 10px; border-bottom: 1px solid #f1f5f9; cursor: pointer; font-size: 12px; }
.trace-row:last-child { border-bottom: 0; }
.trace-row:hover { background: #f8fafc; }
.trace-row.selected { background: #eff6ff; }
.trace-label { display: flex; align-items: center; gap: 6px; min-width: 0; padding-left: calc(var(--depth, 0) * 16px); }
.trace-name { font-weight: 600; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trace-meta { color: #94a3b8; white-space: nowrap; font-variant-numeric: tabular-nums; margin-left: auto; font-size: 11px; }
.trace-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; flex: 0 0 8px; }
.trace-track { position: relative; height: 10px; background: #f1f5f9; border-radius: 5px; }
.trace-bar { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: #64748b; min-width: 3px; }
.trace-node .trace-bar { background: #0284c7; } .trace-node .trace-dot { background: #0284c7; }
.trace-llm .trace-bar { background: #7c3aed; } .trace-llm .trace-dot { background: #7c3aed; }
.trace-tool .trace-bar { background: #0d9488; } .trace-tool .trace-dot { background: #0d9488; }
.trace-agent .trace-bar { background: #2563eb; } .trace-agent .trace-dot { background: #2563eb; }
.trace-status-failed .trace-bar, .trace-status-failed .trace-dot { background: #dc2626; }
.trace-status-warning .trace-bar, .trace-status-warning .trace-dot, .trace-status-retrying .trace-dot { background: #d97706; }
.trace-status-running .trace-bar { background-image: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); background-size: 200% 100%; animation: trace-pulse 1.4s linear infinite; }
@keyframes trace-pulse { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .trace-status-running .trace-bar { animation: none; } }
.trace-hint { padding: 8px 2px; }
.trace-details { border: 1px solid #e2e8f0; border-radius: 8px; }
.trace-details-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #e2e8f0; font-size: 13px; }
.trace-details-body { padding: 10px 12px; font-size: 12.5px; }
.trace-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 10px; }
.trace-kv dt { color: #64748b; } .trace-kv dd { margin: 0; color: #0f172a; font-variant-numeric: tabular-nums; word-break: break-word; }
.trace-msg { margin-bottom: 10px; }
.trace-msg-role { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #7c3aed; margin-bottom: 3px; }
.trace-msg pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 8px 10px; max-height: 300px; overflow: auto; }

/* ---------- Copilot builder steps, usage and undo ---------- */
.copilot-agent-step-bubble.casb-builder-step .casb-task-text { font-size: 12px; }
.copilot-agent-step-bubble.casb-builder-step .casb-task-text strong { color: #0f172a; }
.copilot-agent-step-bubble.casb-failed { border-color: #fecaca; background: #fff7f7; }
.copilot-agent-step-bubble.casb-failed .casb-task-text { color: #b91c1c; }
.casb-fail-mark { width: 15px; height: 15px; border-radius: 50%; background: #fee2e2; color: #b91c1c; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.copilot-usage-line { margin-top: 10px; font-size: 11px; color: #64748b; font-variant-numeric: tabular-nums; }
.copilot-undo-slot { margin-top: 8px; }
.copilot-undo-btn { font-size: 11.5px; font-weight: 600; color: #475569; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.copilot-undo-btn:hover { border-color: #94a3b8; color: #0f172a; }
.copilot-undo-btn:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.copilot-undo-done { font-size: 11.5px; color: #166534; }

/* ---------- Execution tab: step-by-step run view ---------- */
#view-execution { display: flex; flex-direction: column; min-height: 0; }
#view-execution.hidden { display: none; }
.cexec-root { flex: 1; min-height: 0; overflow-y: auto; background: #ffffff; }
.cexec { position: relative; display: flex; flex-direction: column; min-height: 100%; color: #111827; }
.cexec-tabs { display: flex; gap: 4px; padding: 10px 24px; border-bottom: 1px solid #e5e7eb; background: #fff; position: sticky; top: 0; z-index: 3; }
.cexec-tab { border: 0; background: transparent; font-size: 14px; font-weight: 500; color: #374151; padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.cexec-tab:hover { background: #f9fafb; }
.cexec-tab.active { background: #f3f4f6; color: #111827; }
.cexec-tab:focus-visible, .cexec-step-toggle:focus-visible, .cexec-expand:focus-visible, .cexec-seg button:focus-visible, .cexec-copy:focus-visible, .cexec-stop:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }

.cexec-card { padding: 20px 24px 20px; border-bottom: 1px solid #e5e7eb; }
.cexec-card-head { display: flex; align-items: center; gap: 12px; }
.cexec-card-icon { width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid #e5e7eb; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #4b5563; background: #fff; }
.cexec-card-title { min-width: 0; flex: 1; }
.cexec-card-title h3 { margin: 0; font-size: 18px; font-weight: 600; color: #111827; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cexec-card-sub { margin-top: 2px; font-size: 13.5px; color: #6b7280; font-variant-numeric: tabular-nums; }
.cexec-card-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cexec-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.cexec-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cexec-pill-completed .cexec-pill-dot, .cexec-pill-failed .cexec-pill-dot { display: none; }
.cexec-pill-running { color: #c2410c; background: #fff7ed; border-color: #fed7aa; }
.cexec-pill-waiting { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.cexec-pill-completed { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.cexec-pill-warning { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.cexec-pill-failed { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.cexec-pill-cancelled { color: #4b5563; background: #f3f4f6; border-color: #e5e7eb; }
.cexec-rerun { font-size: 12.5px; font-weight: 500; color: #fff; background: #0f766e; border: 1px solid #0f766e; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.cexec-rerun:hover { background: #115e59; }
.cexec-run-num { font-size: 12px; font-weight: 500; color: #6b7280; margin-left: 6px; }
.cexec-history { padding: 16px 32px 32px; }
.cexec-history-scroll { overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 8px; }
.cexec-history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cexec-history-table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #6b7280; background: #f9fafb; padding: 9px 12px; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
.cexec-history-table td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; color: #374151; white-space: nowrap; vertical-align: middle; }
.cexec-history-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cexec-history-table tbody tr { cursor: pointer; }
.cexec-history-table tbody tr:hover td { background: #f9fafb; }
.cexec-history-table tr.is-current td { background: #f0fdfa; }
.cexec-history-num { font-weight: 600; color: #111827; font-variant-numeric: tabular-nums; }
.cexec-history-actions { text-align: right; }
.cexec-history-err td { color: #b91c1c; font-size: 12px; white-space: normal; padding-top: 0; cursor: default; }
.cexec-history-empty { padding: 32px; color: #6b7280; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.cexec-stop { font-size: 12.5px; font-weight: 500; color: #374151; background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.cexec-stop:hover { background: #f9fafb; }
.cexec-progress { margin-top: 16px; height: 4px; width: 100%; background: #f3f4f6; border-radius: 999px; overflow: hidden; }
.cexec-progress > div { height: 100%; border-radius: 999px; background: #f97316; transition: width .5s ease; }
.cexec-progress.is-done > div { background: #10b981; }
.cexec-progress.is-warning > div { background: #f59e0b; }
.cexec-progress.is-failed > div { background: #ef4444; }
.cexec-usage { margin-top: 10px; font-size: 12px; color: #6b7280; font-variant-numeric: tabular-nums; }
.cexec-usage-bad { color: #b91c1c; }
.cexec-run-error { margin-top: 12px; font-size: 13px; color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }

.cexec-starting { flex: 1; min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-size: 15px; color: #4b5563; }
.cexec-steps-label { padding: 22px 24px 4px; font-size: 11.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; }
.cexec-steps { list-style: none; margin: 0; padding: 12px 24px 40px; }
.cexec-none { font-size: 13px; color: #6b7280; }
.cexec-step { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 18px; position: relative; padding-bottom: 20px; }
.cexec-step:not(.last)::before { content: ""; position: absolute; left: 11.5px; top: 30px; bottom: 2px; width: 1px; background: #e5e7eb; }
.cexec-step-rail { padding-top: 2px; }
.cexec-step-icon { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.cexec-step-icon.st-completed { background: #d1fae5; color: #059669; }
.cexec-step-icon.st-warning { background: #fef3c7; color: #b45309; }
.cexec-step-icon.st-failed { background: #fee2e2; color: #dc2626; }
.cexec-step-icon.st-waiting { background: #fef3c7; color: #b45309; }
.cexec-step-icon.st-skipped { background: #f3f4f6; color: #9ca3af; }
.cexec-step-icon.st-running, .cexec-step-icon.st-queued { border: 1.5px solid #d1d5db; }
.cexec-spin { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid #d1d5db; border-top-color: #6b7280; animation: cexec-rot .8s linear infinite; display: inline-block; }
.cexec-spin-lg { width: 22px; height: 22px; border-width: 2px; }
@keyframes cexec-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cexec-spin { animation-duration: 2.4s; } }
.cexec-step-main { min-width: 0; }
.cexec-step-head { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.cexec-step-toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 0; cursor: pointer; min-width: 0; text-align: left; color: inherit; }
.cexec-chev { display: inline-flex; color: #9ca3af; transition: transform .15s ease; }
.cexec-step.open .cexec-chev { transform: rotate(90deg); }
.cexec-step-name { font-size: 16px; font-weight: 500; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cexec-step.st-skipped .cexec-step-name { color: #9ca3af; }
.cexec-expand { margin-left: auto; border: 0; background: transparent; color: #9ca3af; padding: 4px; border-radius: 6px; cursor: pointer; display: inline-flex; }
.cexec-expand:hover { color: #374151; background: #f3f4f6; }
.cexec-step-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.cexec-agent { font-size: 13.5px; color: #374151; background: #f3f4f6; border-radius: 4px; padding: 2px 8px; }
.cexec-dur { font-size: 13.5px; color: #6b7280; font-variant-numeric: tabular-nums; }
.cexec-step-body { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.cexec-step-running { font-size: 13px; color: #6b7280; }
.cexec-step-warning { font-size: 13px; line-height: 1.5; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 10px 12px; }
.cexec-step-warning ul { margin: 6px 0 0; padding-left: 18px; }
.cexec-step-error { font-size: 13px; color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }
.cexec-step-retry { margin-top: 10px; white-space: normal; }
.cexec-step-wait { font-size: 13px; color: #92400e; }
.cexec-step-note { font-size: 12.5px; color: #6b7280; }
.cexec-output { border: 1px solid #e5e7eb; border-radius: 6px; overflow: hidden; background: #fff; }
.cexec-output-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.cexec-seg { display: inline-flex; gap: 2px; }
.cexec-seg button { font-size: 12.5px; font-weight: 500; color: #6b7280; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.cexec-seg button.active { background: #fff; color: #111827; border-color: #e5e7eb; }
.cexec-copy { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #4b5563; background: transparent; border: 0; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.cexec-copy:hover { background: #f3f4f6; color: #111827; }
.cexec-output-body { padding: 16px 18px; }
.cexec-output-body .exec-markdown-content { font-size: 15px; line-height: 1.7; color: #1f2937; max-width: none; }
.cexec-output-body .exec-markdown-content h1 { font-size: 26px; font-weight: 800; line-height: 1.25; margin-top: 0; }
.cexec-output-body .exec-markdown-content h2 { font-size: 20px; font-weight: 700; }
.cexec-output-body .exec-markdown-content h3 { font-size: 16px; font-weight: 700; }
.cexec-output-body .exec-raw-content, .cexec-output-body .exec-json-content { font-size: 12.5px; max-height: 560px; }
.cexec-traces { padding: 16px 24px 40px; }
.cstep-action-host:empty { display: none; }
.cstep-action-host .exec-inline-action-card { position: static; margin: 0; }
@media (max-width: 640px) {
  .cexec-card, .cexec-steps-label, .cexec-steps, .cexec-tabs, .cexec-traces { padding-left: 16px; padding-right: 16px; }
  .cexec-card-head { flex-wrap: wrap; }
}
/* The run view reuses .execution-step-card as a hook for inline prompts; drop the old card look. */
.cexec-step.execution-step-card { display: grid; flex-direction: initial; gap: 0; column-gap: 18px; border: 0; border-radius: 0; padding: 0 0 20px; background: transparent; box-shadow: none; }
.cexec-control { border: 1px solid #e5e7eb; border-radius: 6px; padding: 10px 12px; background: #f9fafb; font-size: 13px; color: #374151; }
.cexec-control-title { font-weight: 600; color: #111827; margin-bottom: 4px; }
.cexec-control ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.cexec-control li { color: #6b7280; }
.cexec-control li.taken { color: #111827; }
.cexec-control code { font-size: 11.5px; background: #fff; border: 1px solid #e5e7eb; border-radius: 4px; padding: 0 4px; color: #4b5563; }
.cexec-branch-mark { display: inline-block; width: 14px; color: #10b981; font-weight: 700; }

.badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-neutral {
  background-color: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tool-readiness-detail {
  font-size: 11px;
  color: var(--slate-500);
  margin-top: 4px;
  max-width: 260px;
  line-height: 1.35;
}

/* Apps (Composio) */
.apps-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.app-card {
  border: 1px solid var(--slate-200); border-radius: 8px; padding: 12px; background: #fff;
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.app-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-card-head img { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; flex-shrink: 0; }
.app-card-name { font-weight: 600; font-size: 13px; color: var(--slate-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card-slug { font-size: 11px; color: var(--slate-400); font-family: var(--font-mono); }
.app-card-desc { font-size: 12px; color: var(--slate-600); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.app-fields { display: flex; flex-direction: column; gap: 6px; }
.app-fields input { font-size: 12px; padding: 6px 8px; border: 1px solid var(--slate-200); border-radius: 6px; min-width: 0; }

/* Tools & Skills: page tabs */
.page-subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--slate-200); margin-bottom: 18px; }
.page-subtab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--slate-500); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.page-subtab:hover { color: var(--slate-800); }
.page-subtab.is-active { color: var(--brand-700); border-bottom-color: var(--brand-600); }
.page-subtab-count { font-size: 11px; font-weight: 600; color: var(--slate-500); background: var(--slate-100); border-radius: 999px; padding: 1px 7px; }
.page-subtab-count:empty { display: none; }

/* Search + filter toolbar */
.list-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.list-search { flex: 1 1 260px; min-width: 0; }
.list-filter { flex: 0 0 auto; width: auto; min-width: 130px; }
.list-result-count { font-size: 12px; color: var(--slate-500); white-space: nowrap; }
.list-toolbar .btn-secondary-action, .list-toolbar .btn-primary-action { margin-left: auto; }
mark.search-hit { background: #fef08a; color: inherit; padding: 0 1px; border-radius: 2px; }

/* Skills */
.skills-layout { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .skills-layout { grid-template-columns: 1fr; } }
.skills-list { display: flex; flex-direction: column; gap: 8px; max-height: 72vh; overflow-y: auto; }
.skill-row {
  border: 1px solid var(--slate-200); border-radius: 8px; padding: 10px 12px; background: #fff; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; text-align: left;
}
.skill-row:hover { border-color: var(--slate-300); }
.skill-row.is-selected { border-color: var(--brand-600); box-shadow: 0 0 0 1px var(--brand-600) inset; }
.skill-row-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.skill-row-name { font-weight: 600; font-size: 13px; color: var(--slate-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-row-desc { font-size: 12px; color: var(--slate-600); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skill-row-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.skill-row.is-disabled { opacity: 0.6; }
.skills-empty { color: var(--slate-400); padding: 40px 20px; text-align: center; border: 1px dashed var(--slate-200); border-radius: 8px; }
.skills-editor { border: 1px solid var(--slate-200); border-radius: 8px; background: #fff; padding: 16px; min-width: 0; }
.skill-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 700px) { .skill-form-grid { grid-template-columns: 1fr; } }
.skill-form-grid .span-2 { grid-column: 1 / -1; }
.skill-files { display: grid; grid-template-columns: 200px 1fr; gap: 12px; margin-top: 6px; }
@media (max-width: 700px) { .skill-files { grid-template-columns: 1fr; } }
.skill-file-list { display: flex; flex-direction: column; gap: 4px; }
.skill-file-item {
  appearance: none; border: 1px solid var(--slate-200); background: var(--slate-50, #f8fafc); border-radius: 6px;
  padding: 7px 9px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font-size: 12px;
}
.skill-file-item.is-active { border-color: var(--brand-600); background: #fff; }
.skill-file-item code { font-weight: 600; color: var(--slate-800); }
.skill-file-kind { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--slate-500); }
.skill-file-editor { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.skill-file-editor textarea {
  width: 100%; min-height: 320px; resize: vertical; font-family: var(--font-mono, ui-monospace, monospace); font-size: 12.5px;
  line-height: 1.5; padding: 10px; border: 1px solid var(--slate-200); border-radius: 6px; box-sizing: border-box;
}
.skill-file-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.skill-file-head input { flex: 1 1 160px; min-width: 0; }
.skill-rules-preview { font-size: 12px; color: var(--slate-600); background: var(--slate-50, #f8fafc); border: 1px solid var(--slate-100); border-radius: 6px; padding: 8px 10px; }
.skill-rules-preview ol { margin: 4px 0 0 18px; padding: 0; }
.skill-editor-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.skill-help { font-size: 11px; color: var(--slate-500); margin-top: 3px; }
.chip-select { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; background: var(--slate-100); color: var(--slate-700); border-radius: 999px; padding: 2px 8px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--slate-500); padding: 0; font-size: 13px; line-height: 1; }
.skill-row, .skill-file-item { align-items: stretch; width: 100%; font: inherit; }
.skill-row > *, .skill-file-item > * { text-align: left; }
.skill-row-meta { justify-content: flex-start; }

/* Skills: markdown editor (GitHub-style) */
.skills-editor { padding: 0; overflow: hidden; }
.skills-editor .skills-empty { margin: 16px; }
.md-editor { display: flex; flex-direction: column; min-width: 0; }
.md-editor-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px 0; background: var(--slate-50); border-bottom: 1px solid var(--slate-200);
}
.md-file-tabs { display: flex; flex-wrap: wrap; gap: 2px; align-items: flex-end; min-width: 0; }
.md-file-tab {
  appearance: none; border: 1px solid transparent; border-bottom: 0; background: none; cursor: pointer;
  font: 600 12px var(--font-mono); color: var(--slate-600); padding: 7px 12px; border-radius: 6px 6px 0 0; margin-bottom: -1px;
}
.md-file-tab:hover { color: var(--slate-900); }
.md-file-tab.is-active { background: #fff; border-color: var(--slate-200); color: var(--slate-900); }
.md-file-add { font-family: inherit; color: var(--brand-700); }
.md-new-file { width: 140px; font-size: 12px; padding: 5px 8px; margin: 0 0 4px 4px; font-family: var(--font-mono); }
.md-enforce { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--slate-700); padding-bottom: 6px; cursor: pointer; }
.md-editor-subbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--slate-100);
}
.md-mode-tabs { display: inline-flex; border: 1px solid var(--slate-200); border-radius: 6px; overflow: hidden; }
.md-mode { appearance: none; border: 0; background: #fff; padding: 5px 12px; font-size: 12px; font-weight: 600; color: var(--slate-600); cursor: pointer; }
.md-mode + .md-mode { border-left: 1px solid var(--slate-200); }
.md-mode.is-active { background: var(--slate-100); color: var(--slate-900); }
.md-file-actions { display: inline-flex; align-items: center; gap: 10px; }
.md-file-role { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--slate-500); }
.md-link-btn {
  appearance: none; display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--slate-300); background: #fff; border-radius: 6px;
  padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--slate-700); cursor: pointer;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
}
.md-link-btn:hover { background: var(--slate-50); border-color: var(--slate-400); color: var(--slate-900); }
.md-link-btn:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 1px; }
.md-link-btn.danger { color: #b91c1c; border-color: #fecaca; background: #fff; }
.md-link-btn.danger:hover { background: #fef2f2; border-color: #f87171; color: #991b1b; }
.md-link-btn.danger[data-armed] { background: #dc2626; border-color: #dc2626; color: #fff; }
.md-textarea {
  width: 100%; min-height: 460px; resize: vertical; border: 0; outline: none; box-sizing: border-box;
  padding: 14px 16px; font: 13px/1.6 var(--font-mono); color: var(--slate-800); tab-size: 2;
}
.md-preview { padding: 14px 20px; min-height: 460px; font-size: 14px; line-height: 1.6; color: var(--slate-800); overflow-x: auto; }
.md-preview h1, .md-preview h2, .md-preview h3 { margin: 1em 0 0.5em; line-height: 1.25; }
.md-preview h1 { font-size: 1.6em; border-bottom: 1px solid var(--slate-200); padding-bottom: 0.3em; }
.md-preview h2 { font-size: 1.3em; border-bottom: 1px solid var(--slate-100); padding-bottom: 0.3em; }
.md-preview pre { background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: 6px; padding: 10px 12px; overflow-x: auto; font-size: 12.5px; }
.md-preview code { font-family: var(--font-mono); font-size: 0.9em; }
.md-preview ul, .md-preview ol { padding-left: 1.6em; }
.md-preview table { border-collapse: collapse; }
.md-preview th, .md-preview td { border: 1px solid var(--slate-200); padding: 4px 8px; }
.md-editor-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-top: 1px solid var(--slate-200); background: var(--slate-50);
}
.md-note { font-size: 12px; color: var(--slate-600); }
.md-editor-foot .skill-editor-actions { margin-top: 0; }

/* Empty states: list and editor placeholders line up as two equal boxes */
.skills-layout { align-items: stretch; }
.skills-editor:has(> .skills-empty) { border: 0; background: none; padding: 0; }
.skills-editor > .skills-empty { margin: 0; }
.skills-list > .skills-empty, .skills-editor > .skills-empty {
  box-sizing: border-box; min-height: 160px; height: 100%;
  display: flex; align-items: center; justify-content: center; text-align: center;
}

/* Second toolbar row: result count on the left, actions on the right */
.list-toolbar-actions { justify-content: space-between; margin-top: -4px; }
.list-toolbar-buttons { display: inline-flex; gap: 8px; margin-left: auto; }
.list-toolbar .list-toolbar-buttons .btn-secondary-action { margin-left: 0; }
.btn-secondary-action:disabled { opacity: 0.5; cursor: default; }

/* Integrations */
.integration-card { border: 1px solid var(--slate-200); border-radius: 10px; background: #fff; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.integration-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.integration-name { font-size: 15px; font-weight: 700; color: var(--slate-900); }
.integration-desc { font-size: 13px; color: var(--slate-600); margin-top: 2px; max-width: 70ch; }
.integration-key-row { display: flex; flex-direction: column; gap: 6px; }
.integration-key-set { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.integration-key-set code { font-size: 13px; background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: 6px; padding: 5px 10px; }
.integration-key-form { display: flex; gap: 8px; flex-wrap: wrap; }
.integration-key-form input { flex: 1 1 320px; min-width: 0; }
.integration-key-form[hidden] { display: none; }
.app-error { font-size: 12px; line-height: 1.45; color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; padding: 8px 10px; }
.apps-loading { gap: 8px; }
#apps-results.is-loading { opacity: 0.55; transition: opacity 0.15s; }

/* Audit log */
.audit-table td { vertical-align: top; }
.audit-row { cursor: pointer; }
.audit-row:hover td, .audit-row.is-open td { background: var(--slate-50); }
.audit-row:focus-visible { outline: 2px solid var(--brand-600); outline-offset: -2px; }
.audit-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit-time span { color: var(--slate-500); }
.audit-num { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--slate-600); }
.audit-method { display: inline-block; min-width: 52px; text-align: center; font: 700 10px var(--font-mono); letter-spacing: 0.04em; border-radius: 4px; padding: 2px 5px; }
.audit-method.m-post { background: #dcfce7; color: #166534; }
.audit-method.m-put, .audit-method.m-patch { background: #dbeafe; color: #1e40af; }
.audit-method.m-delete { background: #fee2e2; color: #991b1b; }
.audit-table code { font-size: 12px; }
.audit-detail { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 16px; padding: 6px 4px 10px; }
@media (max-width: 900px) { .audit-detail { grid-template-columns: 1fr; } }
.audit-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 12px; }
.audit-kv dt { color: var(--slate-500); }
.audit-kv dd { margin: 0; color: var(--slate-800); word-break: break-all; }
.audit-block + .audit-block { margin-top: 10px; }
.audit-pre { margin: 4px 0 0; max-height: 320px; overflow: auto; background: #fff; border: 1px solid var(--slate-200); border-radius: 6px; padding: 8px 10px; font: 12px/1.5 var(--font-mono); white-space: pre-wrap; word-break: break-word; }
.audit-pre.is-error { color: #991b1b; border-color: #fecaca; background: #fef2f2; }

/* Elements hidden with the hidden attribute stay hidden whatever their display style. */
[hidden] { display: none !important; }

/* Agents form */
.agent-form-panel h3 { margin-bottom: 14px; }
.agent-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
@media (max-width: 760px) { .agent-form-grid { grid-template-columns: 1fr; } }
.agent-form-grid .span-2 { grid-column: 1 / -1; }
.agent-form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.agent-form-grid .req { color: var(--danger-500); }
.agent-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.agent-form-actions-right { display: flex; gap: 8px; margin-left: auto; }
.agent-row { cursor: pointer; }
.agent-row:hover td { background: var(--slate-50); }
.agent-row:focus-visible { outline: 2px solid var(--brand-600); outline-offset: -2px; }
.agents-data-table td { vertical-align: top; }

/* Agent details + actions */
.agent-actions { white-space: nowrap; }
.agent-actions .md-link-btn + .md-link-btn { margin-left: 6px; }
.agent-row.is-selected td { background: #ecfdf5; }
.agent-details-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.agent-details-head h3 { margin: 0; }
.agent-details-head .agent-form-actions-right { align-items: center; }
.agent-details-grid { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 0; font-size: 13px; }
@media (max-width: 700px) { .agent-details-grid { grid-template-columns: 1fr; } }
.agent-details-grid dt { color: var(--slate-500); font-weight: 600; font-size: 12px; padding-top: 2px; }
.agent-details-grid dd { margin: 0; min-width: 0; }
.agent-detail-text { white-space: pre-wrap; line-height: 1.5; color: var(--slate-800); }

/* Icon buttons (table row actions) */
.icon-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--slate-200); background: #fff;
  color: var(--slate-600); cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--slate-50); border-color: var(--slate-400); color: var(--slate-900); }
.icon-btn:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 1px; }
.icon-btn.danger { color: #b91c1c; border-color: #fecaca; }
.icon-btn.danger:hover { background: #fef2f2; border-color: #f87171; }
.icon-btn.danger[data-armed] { background: #dc2626; border-color: #dc2626; color: #fff; }
.agent-actions .icon-btn + .icon-btn { margin-left: 6px; }

/* Agent details header: Edit / Delete / Close share one size */
.agent-details-head .agent-form-actions-right > button {
  box-sizing: border-box; height: 32px; padding: 0 14px; font-size: 12.5px; font-weight: 600;
  border-radius: 6px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
#form-create-agent .is-invalid { border-color: #dc2626 !important; box-shadow: 0 0 0 1px #dc2626 !important; }

/* Used by error text and invalid fields across the dashboard. */
:root { --danger-500: #dc2626; }

/* Tool picker (agent form) */
.tool-picker { position: relative; }
.tool-picker-toggle { height: 30px; padding: 0 12px; font-size: 12px; }
.tool-picker-panel {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: min(520px, 100%);
  background: #fff; border: 1px solid var(--slate-200); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14); padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.tool-picker-list { max-height: 340px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.tool-picker-group + .tool-picker-group { margin-top: 8px; }
.tool-picker-cat { position: sticky; top: 0; background: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate-500); padding: 6px 6px 4px; }
.tool-picker-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 6px; border-radius: 6px; cursor: pointer; }
.tool-picker-item:hover { background: var(--slate-50); }
.tool-picker-item input { margin-top: 2px; accent-color: var(--brand-600); flex-shrink: 0; }
.tool-picker-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tool-picker-name { font: 600 12.5px var(--font-mono); color: var(--slate-800); }
.tool-picker-desc { font-size: 12px; color: var(--slate-500); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-picker-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--slate-100); padding-top: 8px; }
.tool-picker-foot .btn-primary-action { height: 30px; padding: 0 14px; font-size: 12px; }
/* Tools field spans the form like the other inputs */
.tool-picker { width: 100%; }
.tool-picker > .chip-select {
  width: 100%; box-sizing: border-box; min-height: 42px; padding: 6px 8px;
  border: 1px solid var(--slate-200); border-radius: 8px; background: #fff; gap: 6px;
}
.tool-picker > .chip-select:focus-within { border-color: var(--brand-600); }
.tool-picker > .chip-select .tool-picker-toggle { margin-left: auto; }
.tool-picker-panel { width: 100%; box-sizing: border-box; }

.run-params-estimate { margin-right: auto; font-size: 12.5px; color: #4b5563; align-self: center; }
.cexec-live { margin-top: 8px; border: 1px solid #e5e7eb; border-left: 3px solid #0f766e; border-radius: 6px; background: #f9fafb; padding: 8px 12px; max-width: 78ch; }
.cexec-live-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #0f766e; margin-bottom: 4px; }
.cexec-live-text { font-size: 13px; line-height: 1.55; color: #374151; white-space: pre-wrap; max-height: 220px; overflow: hidden; display: flex; flex-direction: column-reverse; }

.copilot-steps-group { margin: 2px 0 4px; }
.copilot-steps-group > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; font-size: 11px; color: var(--slate-500); user-select: none; }
.copilot-steps-group > summary::-webkit-details-marker { display: none; }
.copilot-steps-group > summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease; }
.copilot-steps-group[open] > summary::before { transform: rotate(45deg); }
.copilot-steps-group > summary:hover { color: var(--slate-700); }
.copilot-message-bubble .enterprise-badge { font-size: 10.5px; font-weight: 500; color: var(--slate-400); }

.delivery-dialog { width: min(520px, calc(100vw - 32px)); }
.delivery-body { display: flex; flex-direction: column; gap: 10px; }
.delivery-mode { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: var(--radius-md); cursor: pointer; }
.delivery-mode:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); }
.delivery-mode input { margin-top: 3px; accent-color: var(--brand-600); }
.delivery-mode strong { display: block; font-size: 13px; font-weight: 600; color: var(--slate-900); }
.delivery-mode small { display: block; font-size: 12px; color: var(--slate-500); margin-top: 2px; }
.delivery-sub { display: flex; flex-direction: column; gap: 10px; padding: 2px 4px 6px 30px; }
.delivery-apps { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.delivery-app { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--slate-700); padding: 4px 0; cursor: pointer; }
.delivery-app input { accent-color: var(--brand-600); }
.delivery-app-name { flex: 1; }
.delivery-app-state { font-size: 11px; color: var(--slate-400); }
.delivery-app-state.on { color: var(--brand-700); }
.delivery-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--slate-600); }
.delivery-sends-with { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--slate-600); padding-top: 4px; }
.delivery-sends-with strong { color: var(--slate-800); font-weight: 600; }
.delivery-sends-with small { color: var(--slate-500); }
.delivery-field input { font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--slate-300); border-radius: var(--radius-sm); color: var(--slate-900); }
.delivery-field input:focus { outline: 2px solid var(--brand-200); border-color: var(--brand-600); }
.delivery-check { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--slate-700); cursor: pointer; }
.delivery-check input { accent-color: var(--brand-600); }
.delivery-empty { font-size: 12px; color: var(--slate-500); }

.canvas-empty-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; width: min(340px, calc(100% - 32px)); padding: 18px 20px; border: 1.5px dashed var(--slate-300); border-radius: 14px; background: var(--slate-50); color: var(--slate-500); font-size: 12.5px; line-height: 1.55; text-align: center; pointer-events: none; }
.canvas-empty-hint-title { font-size: 13.5px; font-weight: 600; color: var(--slate-800); margin-bottom: 6px; }
.dest-app-logos { background: #fff; border-color: var(--slate-200); gap: 2px; }
.app-logo { display: block; object-fit: contain; border-radius: 3px; }

.task-box-delivery-btn { margin-left: auto; margin-right: 6px; font-size: 10.5px; font-weight: 500; color: var(--slate-600); background: #fff; border: 1px solid var(--slate-200); border-radius: 5px; padding: 2px 7px; cursor: pointer; }
.task-box-delivery-btn:hover { border-color: var(--slate-300); color: var(--slate-800); background: var(--slate-50); }
.delivery-field select { font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--slate-300); border-radius: var(--radius-sm); color: var(--slate-900); background: #fff; }
.cexec-activity { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--slate-600); max-width: 90ch; }
.cexec-activity > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cexec-activity-count { margin-left: auto; flex-shrink: 0; font-size: 11.5px; color: var(--slate-400); font-variant-numeric: tabular-nums; }
.copilot-msg-time { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--slate-400); font-variant-numeric: tabular-nums; }

/* Version history */
.versions-dialog { width: min(640px, 94vw); }
.versions-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.version-row { border: 1px solid var(--slate-200); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.version-row.is-current { border-color: var(--brand-300, #86efac); background: var(--brand-50, #f0fdf4); }
.version-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.version-num { font-weight: 600; font-size: 13px; color: var(--slate-900); }
.version-tag { font-size: 11px; color: var(--slate-600); background: var(--slate-100); border-radius: 999px; padding: 1px 8px; }
.version-time { font-size: 11px; color: var(--slate-500); margin-left: auto; }
.version-summary { font-size: 12.5px; color: var(--slate-700); overflow-wrap: anywhere; }
.version-meta { font-size: 11px; color: var(--slate-500); }
.version-actions { display: flex; gap: 6px; }
.version-actions button { font: inherit; font-size: 12px; padding: 4px 10px; border-radius: var(--radius-sm); border: 1px solid var(--slate-200); background: #fff; color: var(--slate-700); cursor: pointer; }
.version-actions button:hover { border-color: var(--slate-300); color: var(--slate-900); }
.version-actions button.confirm { border-color: #fca5a5; color: #b91c1c; }
.version-diff { font-size: 12px; color: var(--slate-700); background: var(--slate-50); border-radius: var(--radius-sm); padding: 8px 10px; }
.version-diff ul { margin: 4px 0 0; padding-left: 18px; }

/* Pre-run check */
.run-blockers-dialog { width: min(560px, 94vw); }
.run-blockers-intro { margin: 0 0 12px; font-size: 13px; color: var(--slate-600); }
.run-blockers-list { display: flex; flex-direction: column; gap: 8px; }
.run-blocker { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: var(--radius-sm); }
.run-blocker-logo { flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--slate-200); background: #fff; display: inline-flex; align-items: center; justify-content: center; }
.run-blocker-main { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.run-blocker-text { font-size: 13px; color: var(--slate-800); line-height: 1.45; }
.run-blocker-fields { display: flex; flex-direction: column; gap: 6px; }
.run-blocker-fields:empty { display: none; }
.run-blocker.is-fixed { border-color: var(--brand-300, #6ee7b7); background: var(--brand-50); }
.run-blocker-done { font-size: 12px; font-weight: 600; color: var(--brand-700); flex-shrink: 0; }
.app-connect-field { font: inherit; font-size: 12px; padding: 6px 8px; border: 1px solid var(--slate-200); border-radius: 6px; }
.app-connect-field:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }
.run-blocker .btn-primary, .run-blocker .btn-cancel { flex-shrink: 0; white-space: nowrap; font-size: 12px; text-decoration: none; }
.env-row-highlight { box-shadow: 0 0 0 2px var(--brand-400, #4ade80); transition: box-shadow .3s ease; }

/* Drawing connections by hand */
.node-port { position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand-500); z-index: 12; opacity: 0; transition: opacity .12s ease, transform .12s ease; }
.node-port-in { left: -6px; pointer-events: none; }
.node-port-out { right: -6px; cursor: crosshair; }
.node-task-box:hover .node-port-out, .node-task-box.is-selected .node-port-out { opacity: 1; }
.node-port-out:hover { transform: scale(1.25); background: var(--brand-500); }
body.is-connecting .node-port-in { opacity: 1; }
body.is-connecting, body.is-connecting * { cursor: crosshair !important; }
.agent-box-connector-dot[data-connect-from] { cursor: crosshair; }
.agent-box-connector-dot[data-connect-from]:hover { border-color: var(--brand-500); }
.node-task-box.is-connect-target { box-shadow: 0 0 0 2px var(--brand-500), 0 4px 14px rgba(16, 185, 129, .18) !important; }
.canvas-wire-draft { fill: none; stroke: var(--brand-500); stroke-width: 2; stroke-dasharray: 5 4; pointer-events: none; }
.canvas-wire-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.canvas-wire.is-selected { stroke: var(--brand-600) !important; stroke-width: 3 !important; }
.connection-delete-btn { position: absolute; z-index: 20; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  border: 1px solid var(--slate-300); background: #fff; color: var(--slate-600); font-size: 15px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(15, 23, 42, .15); }
.connection-delete-btn:hover { color: #b91c1c; border-color: #fca5a5; }

/* Leaving the workflow */
.leave-dialog { width: min(420px, 92vw); }
.leave-text { margin: 0; font-size: 13.5px; color: var(--slate-700); line-height: 1.5; }

.cexec-control.cexec-control-dead-end { border-color: #fcd34d; background: #fffbeb; }
.cexec-control-hint { margin-top: 6px; font-size: 12px; color: #92400e; }

/* ---------- Files a step made (images, videos, audio, documents) ---------- */
.cexec-files { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 12px; }
.cexec-file { width: 220px; max-width: 100%; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.cexec-file-wide { width: 420px; }
.cexec-file img { display: block; width: 100%; height: 160px; object-fit: cover; background: #f1f5f9; }
.cexec-file video { display: block; width: 100%; max-height: 320px; background: #0f172a; }
.cexec-file audio { display: block; width: 100%; padding: 10px; box-sizing: border-box; }
.cexec-file-placeholder { height: 120px; display: flex; align-items: center; justify-content: center; color: #64748b; font-size: 12px; background: #f8fafc; }
.cexec-file-doc-link { display: block; padding: 18px 12px; color: #0f172a; text-decoration: none; font-size: 13px; overflow-wrap: anywhere; }
.cexec-file-caption { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 12px; color: #334155; border-top: 1px solid #f1f5f9; }
.cexec-file-caption > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cexec-file-meta { color: #94a3b8; font-variant-numeric: tabular-nums; }
.cexec-file-download { color: var(--brand-700); text-decoration: none; font-weight: 600; }
.cexec-file-download:hover { text-decoration: underline; }

.cexec-result { margin: 12px 0 4px; padding: 14px 16px; border: 1px solid #bbf7d0; background: #f0fdf4; border-radius: 10px; }
.cexec-result-title { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-700, #15803d); margin-bottom: 8px; }
.cexec-result .cexec-files { margin: 0; }
.cexec-files-inter { margin: 2px 0 12px; }
.cexec-files-inter > summary { cursor: pointer; font-size: 12px; color: #64748b; padding: 4px 0; }
.cexec-files-inter[open] > summary { margin-bottom: 6px; }
.cexec-approve-files { margin: 8px 0; }


/* Chat history (chat mode) */
.studio-chat-header { gap: 12px; flex-wrap: wrap; }
.chat-history-count {
  font-size: 11px; font-weight: 600; color: var(--slate-500);
  background: var(--slate-100); border-radius: 9999px; padding: 1px 8px;
}
.chat-history-count:empty { display: none; }
.chat-history-search {
  flex: 1 1 200px; max-width: 280px; font-size: 12.5px; padding: 6px 10px;
  border: 1px solid var(--slate-200); border-radius: 8px; background: #fff; color: var(--slate-800);
}
.chat-history-search:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 3px var(--brand-50); }
.chat-history-list { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; }
.chat-history-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 12px 18px; border-bottom: 1px solid var(--slate-100); text-decoration: none; color: inherit;
  transition: background 0.12s ease;
}
.chat-history-item:last-child { border-bottom: none; }
.chat-history-item:hover, .chat-history-item:focus-visible { background: var(--slate-50); outline: none; }
.chat-history-main { min-width: 0; flex: 1; }
.chat-history-title {
  font-size: 13.5px; font-weight: 600; color: var(--slate-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-history-preview {
  margin-top: 3px; font-size: 12.5px; color: var(--slate-500); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.chat-history-you { color: var(--slate-700); font-weight: 600; }
.chat-history-meta {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  font-size: 11.5px; color: var(--slate-400); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chat-history-empty { padding: 22px 18px; font-size: 13px; color: var(--slate-500); text-align: center; }
@media (max-width: 640px) {
  .chat-history-item { flex-direction: column; gap: 6px; }
  .chat-history-meta { flex-direction: row; gap: 10px; align-items: center; }
  .chat-history-search { max-width: none; }
}


/* Copilot assistant cards in the Studio's Copilot panel (confirm an action, follow a run) */
.copilot-action-card { margin-top: 10px; border: 1px solid var(--slate-200); border-radius: 10px; padding: 10px 12px; background: #fff; font-size: 12px; }
.copilot-action-card.status-pending { border-color: var(--brand-300); box-shadow: 0 0 0 3px var(--brand-50); }
.copilot-action-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.copilot-action-title { font-weight: 600; color: var(--slate-900); font-size: 12.5px; }
.copilot-action-status { font-size: 10.5px; font-weight: 600; border-radius: 999px; padding: 1px 8px; background: var(--slate-100); color: var(--slate-600); }
.status-done .copilot-action-status { background: var(--brand-50); color: var(--brand-700); }
.status-failed .copilot-action-status { background: #fef2f2; color: #b91c1c; }
.copilot-action-fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 10px; margin: 8px 0 0; }
.copilot-action-fields dt { color: var(--slate-500); }
.copilot-action-fields dd { margin: 0; color: var(--slate-800); overflow-wrap: anywhere; }
.copilot-action-error { margin-top: 6px; color: #b91c1c; }
.copilot-action-buttons { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.copilot-action-btn { border: 1px solid var(--slate-200); background: #fff; border-radius: 7px; padding: 5px 11px; font-size: 12px; cursor: pointer; }
.copilot-action-btn.primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.copilot-action-btn:disabled { opacity: .55; cursor: default; }
.copilot-run-body { margin-top: 4px; color: var(--slate-700); }

/* The Copilot panel's send button while a turn runs: Stop */
.copilot-send-btn.is-stop { background: var(--slate-900); color: #fff; }
.copilot-send-btn.is-stop:hover { background: var(--slate-700); }

/* Dashboard prompt: sending it empty asks for the automation first */
.prompt-box-wrapper { transition: border-color .4s ease; }
.prompt-box-wrapper.needs-text { border-color: var(--danger-300, #fca5a5); animation: prompt-nudge .35s ease; }
@keyframes prompt-nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* The dashboard's send button reads as disabled until there's a prompt */
.prompt-submit-btn.is-empty, .prompt-submit-btn.is-empty:hover, .prompt-submit-btn.is-empty:active {
  background: var(--slate-200); color: var(--slate-400); box-shadow: none; transform: none; cursor: not-allowed;
}

/* Templates: search and category filter */
.templates-toolbar { margin-bottom: 16px; flex-wrap: wrap; }
.templates-count { font-size: 12.5px; color: var(--slate-500); font-variant-numeric: tabular-nums; }
.templates-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px 16px; color: var(--slate-500); font-size: 13.5px; text-align: center; }
.templates-empty p { margin: 0; }
@media (max-width: 640px) {
  .templates-toolbar .search-input-wrap { margin-left: 0 !important; width: 100%; }
  .templates-toolbar .search-input-box { width: 100%; }
}

/* The account's photo inside the avatar circles */
.sidebar-user-avatar.has-photo, .user-modal-avatar.has-photo, .profile-avatar.has-photo { background: var(--slate-100); overflow: hidden; }
.account-avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
