/* ============================================================
   TRIAGE GPT — Custom Stylesheet
   Design System: CommsConnect AI
   ============================================================ */

/* ── Smooth global transitions ─────────────────────────────── */
button, input, select, textarea {
  transition: all 0.2s ease;
}

/* ════════════════════════════════════════════════════════════
   0. BOOT DETECTION SCREEN
   ════════════════════════════════════════════════════════════ */

.triage-detect-screen {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 2rem 1rem;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 280ms ease, transform 280ms ease;
}

.triage-detect-screen.hidden {
  display: none !important;
}

.triage-detect-screen.is-hiding {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.triage-detect-card {
  width: 100%;
  max-width: 400px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
}

.triage-detect-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.triage-detect-card .triage-spinner-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 0.75rem;
}

.triage-detect-status {
  margin: 0;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.5;
  transition: opacity 200ms ease;
}

/* ════════════════════════════════════════════════════════════
   1. WELCOME SCREEN
   ════════════════════════════════════════════════════════════ */

.triage-welcome-screen {
  position: relative !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 2rem 1rem !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

/* Ambient blobs — hidden on light background */
.triage-blob { display: none !important; }

/* Card — solid on light background */
.triage-glass-card {
  position: relative !important;
  z-index: 10 !important;
  width: 100% !important;
  max-width: 560px !important;
  background: #f8fafc !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 1.5rem !important;
  padding: 2.5rem 2.25rem !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04) !important;
  box-sizing: border-box !important;
}

/* Brand row */
.triage-brand-row {
  display: flex !important;
  align-items: center !important;
  gap: 0.65rem !important;
  margin-bottom: 1.6rem !important;
}
.triage-brand-icon {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
  border-radius: 11px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: white !important;
  flex-shrink: 0 !important;
  box-shadow: 0 4px 14px rgba(37,99,235,0.4) !important;
}
.triage-brand-name {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
}

/* Hero text */
.triage-hero-title {
  font-size: 2.3rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.15 !important;
  margin: 0 0 0.55rem !important;
  letter-spacing: -0.03em !important;
  text-decoration: none !important;
}
.triage-hero-sub {
  font-size: 0.9rem !important;
  color: #64748b !important;
  margin: 0 0 1.85rem !important;
  line-height: 1.65 !important;
}

/* Form */
.triage-welcome-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
  margin-bottom: 1.5rem !important;
}
.triage-form-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0.75rem !important;
}
.triage-field-input {
  width: 100% !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 0.75rem !important;
  padding: 0.75rem 1rem !important;
  color: #0f172a !important;
  font-size: 0.875rem !important;
  outline: none !important;
  box-sizing: border-box !important;
  display: block !important;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
}
.triage-field-input::placeholder { color: #9ca3af !important; }
.triage-field-input:focus {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15) !important;
  outline: none !important;
}

/* Validation error state */
.triage-field-input.triage-field-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15) !important;
}
.triage-field-error-msg {
  display: block;
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

/* CTA button */
.triage-start-btn {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%) !important;
  color: white !important;
  border: none !important;
  border-radius: 0.75rem !important;
  padding: 0.9rem 1.5rem !important;
  font-size: 0.93rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(37,99,235,0.38) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}
.triage-start-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: left 0.55s ease;
}
.triage-start-btn:hover::after { left: 100%; }
.triage-start-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 28px rgba(37,99,235,0.48) !important;
}
.triage-start-btn:active { transform: translateY(0) !important; }

/* Service badges */
.triage-service-badges {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.45rem !important;
}
.triage-service-badge {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  color: #64748b !important;
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  padding: 0.28rem 0.72rem !important;
  border-radius: 999px !important;
  letter-spacing: 0.01em !important;
  display: inline-block !important;
}

/* ════════════════════════════════════════════════════════════
   2. POST-WELCOME GREETING
   ════════════════════════════════════════════════════════════ */

.triage-greeting-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0.5rem 0 0.75rem;
}
.triage-returning-note {
  display: flex;
}
.triage-greeting-text {
  font-size: 1.7rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 0 0.2rem !important;
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
}

/* ════════════════════════════════════════════════════════════
   3. CHAT CONTAINER
   ════════════════════════════════════════════════════════════ */

.triage-chat-container {
  max-width: 860px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 28px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
}

/* Chat header */
.triage-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.triage-chat-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.triage-status-pulse {
  width: 9px;
  height: 9px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
  animation: statusPulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes statusPulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(34,197,94,0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(34,197,94,0.07); }
}
.triage-chat-brand-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
}
.triage-service-chip {
  font-size: 0.71rem;
  font-weight: 500;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.triage-service-chip:empty { display: none; }

/* ════════════════════════════════════════════════════════════
   4. MESSAGES AREA
   ════════════════════════════════════════════════════════════ */

.triage-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 1.25rem 0.75rem;
  overflow-y: auto;
  max-height: 500px;
  background: transparent;
  scroll-behavior: smooth;
}

/* Message row entrance animation */
.triage-msg-row {
  animation: msgIn 0.22s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes msgIn {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0);    }
}

/* AI bubble */
.triage-ai-bubble {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #e8edf3 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
}

/* User bubble */
.triage-user-bubble {
  background: linear-gradient(135deg, #2563eb 0%, #4338ca 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 3px 12px rgba(37,99,235,0.22) !important;
}
.triage-user-bubble .text-gray-400 { color: rgba(255,255,255,0.52) !important; }

/* Success bubble */
.triage-success-bubble {
  background: #f0fdf4 !important;
  color: #14532d !important;
  border: 1px solid #86efac !important;
}

/* AI avatar */
.triage-ai-avatar {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%) !important;
  box-shadow: 0 2px 8px rgba(37,99,235,0.28) !important;
  flex-shrink: 0;
}

/* User avatar */
.triage-user-avatar {
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%) !important;
  flex-shrink: 0;
}

/* Option pills inside question bubbles */
.triage-option-pill {
  background: #f0f4ff !important;
  color: #2563eb !important;
  border: 1.5px solid #bfdbfe !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  padding: 0.35rem 0.9rem !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  transition: all 0.14s ease !important;
}
.triage-option-pill:hover {
  background: #dbeafe !important;
  border-color: #2563eb !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(37,99,235,0.18) !important;
}

/* Rich typography inside bubbles */
#triage-messages .rounded-lg h1,
#triage-messages .rounded-lg h2,
#triage-messages .rounded-lg h3,
#triage-messages .rounded-lg p,
#triage-messages .rounded-lg ul,
#triage-messages .rounded-lg ol { margin: 0; }

#triage-messages .rounded-lg h1 { font-size:1.15rem; font-weight:700; margin-bottom:.4rem; line-height:1.5; }
#triage-messages .rounded-lg h2 { font-size:1rem; font-weight:650; margin:.6rem 0 .28rem; line-height:1.5; }
#triage-messages .rounded-lg h3 { font-size:.93rem; font-weight:640; margin:.5rem 0 .2rem; line-height:1.5; }
#triage-messages .rounded-lg p  { margin:.28rem 0; }
#triage-messages .rounded-lg ul,
#triage-messages .rounded-lg ol { margin:.32rem 0; padding-left:1.2rem; }
#triage-messages .rounded-lg ul { list-style: disc; }
#triage-messages .rounded-lg ol { list-style: decimal; }
#triage-messages .rounded-lg li { margin:.14rem 0; }
#triage-messages .rounded-lg    { overflow-wrap:anywhere; word-break:break-word; }
div#triage-messages a { color:#2563eb !important; text-decoration:underline; }
#triage-messages .triage-cta-buttons a { color:#ffffff !important; text-decoration:underline; }

/* ════════════════════════════════════════════════════════════
   5. TYPING & LOADING INDICATORS
   ════════════════════════════════════════════════════════════ */

.triage-typing-indicator {
  padding: 0.4rem 1.25rem 0.6rem;
  display: flex;
  align-items: center;
}
.triage-dot-row {
  display: flex;
  gap: 5px;
  background: #ffffff;
  border: 1px solid #e8edf3;
  border-radius: 999px 999px 999px 5px;
  padding: 0.55rem 0.9rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.triage-dot {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: dotBounce 1.3s ease-in-out infinite;
}
.triage-dot:nth-child(1) { animation-delay:   0ms; }
.triage-dot:nth-child(2) { animation-delay: 160ms; }
.triage-dot:nth-child(3) { animation-delay: 320ms; }
@keyframes dotBounce {
  0%,60%,100% { transform:translateY(0);    opacity:.45; }
  30%          { transform:translateY(-7px); opacity:1;   }
}

/* Legacy dot-flash compat (hidden, just a noop) */
.dot-flash { display: none; }

/* Loading row */
.triage-loading-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.25rem;
  color: #64748b;
  font-size: 0.82rem;
}
.triage-spinner-dots { display:flex; gap:4px; }
.triage-spinner-dots span {
  width: 7px; height: 7px;
  background: #2563eb;
  border-radius: 50%;
  animation: dotBounce 1.3s ease-in-out infinite;
}
.triage-spinner-dots span:nth-child(1) { animation-delay:   0ms; }
.triage-spinner-dots span:nth-child(2) { animation-delay: 160ms; }
.triage-spinner-dots span:nth-child(3) { animation-delay: 320ms; }
.triage-loading-text { font-style: italic; color:#64748b; }

/* ════════════════════════════════════════════════════════════
   6. SUGGESTION PILLS (AI-generated options)
   ════════════════════════════════════════════════════════════ */

.triage-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.25rem 1.25rem 0.75rem;
}

#triage-suggestions button {
  background: #ffffff !important;
  color: #374151 !important;
  border: 1.5px solid #d1d5db !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  padding: 0.42rem 1.1rem !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  white-space: nowrap;
  transition: all 0.14s ease !important;
}
#triage-suggestions button:hover {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 10px rgba(37,99,235,0.14) !important;
}

/* Selected pill (multi-select active) */
.triage-pill-selected,
#triage-suggestions button.triage-pill-selected {
  background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(37,99,235,0.28) !important;
}

/* Multi-select action buttons (Done / Clear) */
.triage-multi-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}
.triage-multi-actions button {
  border-radius: 0.625rem !important;
  font-weight: 600 !important;
  padding: 0.42rem 1.25rem !important;
}

/* ════════════════════════════════════════════════════════════
   7. INITIAL PROMPT PILLS (quick-start buttons)
   ════════════════════════════════════════════════════════════ */

.triage-initial-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem 1rem;
}
.triage-prompt-btn {
  background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  color: #475569 !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  padding: 0.38rem 0.875rem !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  white-space: nowrap;
  transition: all 0.14s ease !important;
}
.triage-prompt-btn:hover {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(37,99,235,0.12) !important;
}

/* ════════════════════════════════════════════════════════════
   8. INPUT AREA
   ════════════════════════════════════════════════════════════ */

.triage-input-wrapper {
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  padding: 0.875rem 1rem 0.75rem;
  flex-shrink: 0;
}
.triage-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 1rem;
  padding: 0.45rem 0.45rem 0.45rem 0.875rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.triage-input-row:focus-within {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.triage-chat-input {
  flex: 1;
  min-height: 38px;
  max-height: 180px;
  overflow-y: auto;
  outline: none;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #0f172a;
  background: transparent;
  padding: 0.45rem 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.triage-chat-input:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}
/* Rich text inside input */
.triage-chat-input h1 { font-size:1.15rem; font-weight:700; margin-bottom:.38rem; }
.triage-chat-input h2 { font-size:1rem; font-weight:650; margin:.6rem 0 .25rem; }
.triage-chat-input h3 { font-size:.93rem; font-weight:640; margin:.5rem 0 .2rem; }
.triage-chat-input p  { margin:.28rem 0; }
.triage-chat-input ul,
.triage-chat-input ol { padding-left:1.2rem; margin:.32rem 0; }
.triage-chat-input ul { list-style:disc; }
.triage-chat-input ol { list-style:decimal; }
.triage-chat-input li { margin:.14rem 0; }

/* Send button */
.triage-send-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 0.75rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 2px 10px rgba(37,99,235,0.32) !important;
  transition: transform 0.14s ease, box-shadow 0.14s ease !important;
}
.triage-send-btn:hover {
  transform: scale(1.07) !important;
  box-shadow: 0 4px 16px rgba(37,99,235,0.42) !important;
}
.triage-send-btn:active { transform: scale(0.93) !important; }

/* Live word count under input row (left side) */
.triage-word-count {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  margin-left: 0.2rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.67rem;
  line-height: 1;
  font-weight: 600;
}

.triage-word-count.is-over {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* Input hint */
.triage-input-hint {
  font-size: 0.67rem;
  color: #94a3b8;
  margin: 0.4rem 0 0;
  text-align: right;
  padding-right: 0.25rem;
}
.triage-input-hint kbd {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 0.04rem 0.28rem;
  font-size: 0.64rem;
  font-family: inherit;
}

/* ════════════════════════════════════════════════════════════
   9. RESET / CONTROL BAR
   ════════════════════════════════════════════════════════════ */

.triage-reset-bar {
  max-width: 860px;
  margin: 0.6rem auto 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.triage-ctrl-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  padding: 0.35rem 0.85rem !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 999px !important;
  font-size: 0.74rem !important;
  color: #64748b !important;
  cursor: pointer !important;
  transition: all 0.14s ease !important;
}
.triage-ctrl-btn:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

/* Reset warning dialog */
.triage-reset-warning-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.triage-reset-warning-dialog {
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  padding: 1rem;
}

.triage-reset-warning-dialog h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1.05rem;
  line-height: 1.3;
}

.triage-reset-warning-dialog p {
  margin: 0.45rem 0 0;
  color: #475569;
  font-size: 0.87rem;
}

.triage-reset-warning-list {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: #334155;
  font-size: 0.82rem;
  line-height: 1.45;
}

.triage-reset-warning-actions {
  margin-top: 0.95rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.triage-reset-warning-btn {
  border-radius: 0.55rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.triage-reset-warning-btn:hover {
  background: #f8fafc;
}

.triage-reset-warning-confirm {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.triage-reset-warning-confirm:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* "Start a new request" button shown after triage completion */
.triage-new-request-btn {
  display: block !important;
  width: 100% !important;
  margin-top: 0.75rem !important;
  padding: 0.5rem 1rem !important;
  font-size: 0.82rem !important;
  color: #94a3b8 !important;
  background: transparent !important;
  border: 1px solid #475569 !important;
  border-radius: 0.5rem !important;
  cursor: pointer !important;
  transition: background 0.15s ease, color 0.15s ease !important;
  text-align: center !important;
}
.triage-new-request-btn:hover {
  background: rgba(255,255,255,0.06) !important;
  color: #e2e8f0 !important;
  border-color: #64748b !important;
}

/* ════════════════════════════════════════════════════════════
   10. DISCLAIMER
   ════════════════════════════════════════════════════════════ */

.triage-disclaimer {
  max-width: 860px;
  margin: 0.6rem auto 0;
  padding: 0 0.5rem;
}
.triage-disclaimer p {
  font-size: 0.68rem !important;
  color: #94a3b8 !important;
  text-align: center !important;
  margin: 0 !important;
  line-height: 1.55 !important;
}
.triage-disclaimer strong {
  color: #64748b !important;
  font-size: 0.66rem !important;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* ════════════════════════════════════════════════════════════
   11. SELF-HELP CTA (JS-rendered)
   ════════════════════════════════════════════════════════════ */

[data-selfhelp-cta] .flex.flex-wrap.gap-2 button,
[data-selfhelp-cta] .flex.flex-wrap.gap-2 a {
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  color: #2563eb;
  padding: 0.42rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.14s ease;
}
[data-selfhelp-cta] .flex.flex-wrap.gap-2 button:hover,
[data-selfhelp-cta] .flex.flex-wrap.gap-2 a:hover {
  background: #dbeafe;
  border-color: #2563eb;
  transform: translateY(-1px);
}

/* ════════════════════════════════════════════════════════════
   12. MOBILE OVERRIDES (≤ 640px)
   ════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .triage-welcome-screen {
    border-radius: 0 !important;
    min-height: 100svh !important;
    align-items: flex-start !important;
    padding: 3rem 1rem 2rem !important;
  }
  .triage-glass-card {
    padding: 2rem 1.25rem !important;
    max-width: 100% !important;
  }
  .triage-form-row { grid-template-columns: 1fr !important; }
  .triage-hero-title { font-size: 1.8rem !important; }

  .triage-chat-container {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
  }
  .triage-messages { max-height: 380px !important; padding: 1rem 0.875rem 0.5rem !important; }
  .triage-input-wrapper { padding: 0.75rem !important; }
  .triage-suggestions,
  .triage-initial-prompts { padding-left: 0.875rem !important; padding-right: 0.875rem !important; }
  .triage-chat-header { padding: 0.75rem 0.875rem !important; }
}

/* ════════════════════════════════════════════════════════════
   13. UTILITIES & COMPAT
   ════════════════════════════════════════════════════════════ */

/* Ensure .hidden always hides */
.hidden { display: none !important; }

/* Legacy loader spinner */
.loader {
  border: 3px solid #f0f4f8;
  border-top: 3px solid #2563eb;
  border-radius: 50%;
  width: 20px; height: 20px;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes spin {
  0%   { transform: rotate(0deg);   }
  100% { transform: rotate(360deg); }
}

/* Colour utilities (for any inline / legacy use) */
.bg-orange-500  { background-color: #f97316; }
.bg-blue-500    { background-color: #3b82f6; }
.bg-blue-50     { background-color: #eff6ff; }
.bg-green-50    { background-color: #f0fdf4; }
.text-white     { color: #ffffff; }
.text-blue-900  { color: #1e3a8a; }
.text-green-900 { color: #166534; }
.border-green-200 { border-color: #bbf7d0; }


/* Simple loader spinner */
.loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #38bdf8; /* Tailwind sky-400 */
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.dot-flash::after {
  content: '...';
  animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {
  0%   { content: '.'; }
  33%  { content: '..'; }
  66%  { content: '...'; }
  100% { content: '.'; }
}

/* ──────────────────────────────────────────────────────────────────────────── */
/* Mobile overrides: full-width, no box or shadow and no padding under 640px */
@media (max-width: 640px) {
  .asana-form-wrapper,
  #triage-chat {
    background: transparent !important;
    box-shadow: none       !important;
    border: none           !important;
    border-radius: 0       !important;
    margin: 0              !important;

    /* force full-width */
    width: 100%            !important;
    max-width: none        !important;

    /* strip out any leftover padding */
    padding: 0 !important;
  }
}


/* Smooth fade-in for assistant messages */
.triage-assistant-message {
  opacity: 1;

}

.triage-assistant-message.show {
  opacity: 1;

}

/* Scale effect on suggestion buttons */
#triage-suggestions button {

}

#triage-suggestions button:hover {
 
}

/* Extra smoothness for form and prompt buttons */
.triage-prompt-btn {
 
}

.triage-prompt-btn:hover {
  
}


/* Fake Tailwind utility colors */
.bg-orange-500 {
  background-color: #f97316; /* Tailwind orange-500 */
}

.bg-blue-500 {
  background-color: #3b82f6; /* Tailwind blue-500 */
}

.bg-blue-50 {
  background-color: #eff6ff; /* Tailwind blue-50 */
}

.bg-green-50 {
  background-color: #f0fdf4; /* Tailwind green-50 */
}

.text-white {
  color: #ffffff;
}

.text-blue-900 {
  color: #1e3a8a;
}

.text-green-900 {
  color: #166534;
}

.border-green-200 {
  border-color: #bbf7d0;
}

#triage-input {
  min-height: 48px;   /* about 3 lines */
  max-height: 240px;  /* cap at ~15 lines before scroll */
  overflow-y: auto;
}

#triage-input:empty:before {
  content: attr(data-placeholder);
  color: #9ca3af; /* gray-400 */
  pointer-events: none;
}

div#triage-messages a {
    color: #1d4ed8 !important;
}

[data-selfhelp-cta] .flex.flex-wrap.gap-2 button,
[data-selfhelp-cta] .flex.flex-wrap.gap-2 a {
  background: #ededed;
  padding: 0.5rem 1rem;
}

.triage-multi-actions {
  display: flex;      /* or block, if suggestionsEl is not flex */
  justify-content: flex-start;
  margin-top: 0.75rem;
}


/* ───────────────────────────────────────────────────────────── */
/* Rich text typography inside chat bubbles (user + assistant)    */
/* Applies to the message bubble divs created in renderMessage()  */
/* ───────────────────────────────────────────────────────────── */

#triage-messages .rounded-lg h1,
#triage-messages .rounded-lg h2,
#triage-messages .rounded-lg h3,
#triage-messages .rounded-lg p,
#triage-messages .rounded-lg ul,
#triage-messages .rounded-lg ol {
  margin: 0;
}

#triage-messages .rounded-lg h1 {
  font-size: 1.25rem;
  line-height: 1.6;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

#triage-messages .rounded-lg h2 {
  font-size: 1.05rem;
  line-height: 1.6;
  font-weight: 650;
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
}

#triage-messages .rounded-lg h3 {
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 650;
  margin-top: 0.6rem;
  margin-bottom: 0.25rem;
}

#triage-messages .rounded-lg p {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

#triage-messages .rounded-lg ul,
#triage-messages .rounded-lg ol {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
  padding-left: 1.25rem;
}

#triage-messages .rounded-lg ul {
  list-style: disc;
}

#triage-messages .rounded-lg ol {
  list-style: decimal;
}

#triage-messages .rounded-lg li {
  margin: 0.2rem 0;
}

/* Keep long words/URLs from blowing out the bubble */
#triage-messages .rounded-lg {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ───────────────────────────────────────────────────────────── */
/* Rich text styling inside the contenteditable input (#triage-input) */
/* ───────────────────────────────────────────────────────────── */

#triage-input h1,
#triage-input h2,
#triage-input h3,
#triage-input p,
#triage-input ul,
#triage-input ol {
  margin: 0;
}

#triage-input h1 {
  font-size: 1.25rem;
  line-height: 1.6;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

#triage-input h2 {
  font-size: 1.05rem;
  line-height: 1.6;
  font-weight: 650;
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
}

#triage-input h3 {
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 650;
  margin-top: 0.6rem;
  margin-bottom: 0.25rem;
}

#triage-input p {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

/* Theme resets often kill bullets/numbers — force them back inside the editor */
#triage-input ul,
#triage-input ol {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
  padding-left: 1.25rem;
}

#triage-input ul { list-style: disc; }
#triage-input ol { list-style: decimal; }

#triage-input li {
  margin: 0.2rem 0;
}

/* Prevent long URLs from blowing out the editor width */
#triage-input {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Keep pasted rich HTML readable inside user bubbles.
   Theme and utility styles can target nested tags (p/li/h1/a) and override the bubble color. */
div#triage-messages .triage-user-bubble,
div#triage-messages .triage-user-bubble * {
  color: #ffffff !important;
}

/* Preserve visual hierarchy in user bubbles. */
div#triage-messages .triage-user-bubble .text-gray-400 {
  color: rgba(255,255,255,0.52) !important;
}

/* Links remain readable on the blue gradient. */
div#triage-messages .triage-user-bubble a {
  color: #dbeafe !important;
  text-decoration: underline;
}

/* Force assistant links to display as CTA buttons */
div#triage-messages .triage-ai-bubble a,
div#triage-messages .triage-ai-bubble a.triage-link {
  display: inline-block !important;
  margin-top: 0.35rem !important;
  padding: 0.48rem 0.95rem !important;
  border-radius: 0.7rem !important;
  border: 1px solid #dbeafe !important;
  background: #2563eb !important;
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25) !important;
}

div#triage-messages .triage-ai-bubble a:hover,
div#triage-messages .triage-ai-bubble a.triage-link:hover {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

