/* ==========================================================================
   SupportHub Live Support Widget — Agodify / Intercom Modern Hub Layout
   ========================================================================== */

#sh-chat-widget-root {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  color: #0f172a;
  font-size: 14px;
}

#sh-chat-widget-root *,
#sh-chat-widget-root *::before,
#sh-chat-widget-root *::after {
  box-sizing: border-box !important;
  margin: 0;
  padding: 0;
}

/* ── Floating Launcher Bubble ── */
.sh-widget-bubble {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  width: 60px !important;
  height: 60px !important;
  border-radius: 50% !important;
  background: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  box-shadow: 0 10px 25px -4px rgba(37, 99, 235, 0.45), 0 4px 8px -2px rgba(37, 99, 235, 0.2) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.15s ease !important;
  z-index: 2147483647 !important;
  outline: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.sh-widget-bubble svg,
.sh-widget-bubble path,
.sh-widget-bubble span {
  pointer-events: none !important;
}

.sh-widget-bubble:hover {
  background: #1d4ed8 !important;
  transform: scale(1.06) translateY(-2px) !important;
  box-shadow: 0 14px 30px -4px rgba(37, 99, 235, 0.55), 0 6px 12px -3px rgba(37, 99, 235, 0.3) !important;
}

.sh-widget-bubble:active {
  transform: scale(0.96) !important;
}

.sh-widget-bubble svg {
  width: 26px !important;
  height: 26px !important;
  stroke: #ffffff !important;
  stroke-width: 2.2 !important;
}

/* ── Main Panel Container ── */
#sh-widget-panel,
.sh-widget-panel {
  position: fixed !important;
  bottom: 96px !important;
  right: 24px !important;
  width: 410px !important;
  max-width: calc(100vw - 32px) !important;
  height: 600px !important;
  max-height: calc(100vh - 120px) !important;
  background: #ffffff !important;
  border-radius: 24px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 24px 54px -12px rgba(15, 23, 42, 0.18), 0 4px 16px -2px rgba(15, 23, 42, 0.08) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  z-index: 2147483646 !important;
  animation: sh-panel-slide 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  transform-origin: bottom right !important;
}

#sh-widget-panel:not(.sh-panel-open),
.sh-widget-panel:not(.sh-panel-open) {
  display: none !important;
}

@keyframes sh-panel-slide {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── 1. HUB HOME SCREEN (Hero & Navigation) ── */
.sh-hub-home-view {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  background: #ffffff !important;
}

/* Hero Section with Vibrant Gradient */
.sh-hub-hero {
  position: relative !important;
  background: linear-gradient(145deg, #6366f1 0%, #4f46e5 35%, #2563eb 100%) !important;
  color: #ffffff !important;
  padding: 32px 24px 38px !important;
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.sh-hub-close-btn {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.16) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: background 0.15s ease !important;
}

.sh-hub-close-btn:hover {
  background: rgba(255, 255, 255, 0.28) !important;
}

.sh-hub-close-btn svg {
  width: 16px !important;
  height: 16px !important;
  stroke: #ffffff !important;
}

/* Centered Brand Squircle Card */
.sh-brand-badge-card {
  width: 90px !important;
  height: 90px !important;
  background: #ffffff !important;
  border-radius: 24px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.18) !important;
  margin-bottom: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
}

.sh-brand-title {
  font-size: 14.5px !important;
  font-weight: 800 !important;
  color: #1e293b !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 5px !important;
}

.sh-brand-dots {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.sh-dot {
  width: 5px !important;
  height: 5px !important;
  border-radius: 50% !important;
}

.sh-dot-yellow { background: #f59e0b !important; }
.sh-dot-blue   { background: #3b82f6 !important; }
.sh-dot-red    { background: #ef4444 !important; }
.sh-dot-green  { background: #10b981 !important; }
.sh-dot-purple { background: #8b5cf6 !important; }

.sh-hub-headline {
  font-size: 21px !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
  line-height: 1.25 !important;
  color: #ffffff !important;
  margin-bottom: 6px !important;
}

.sh-hub-subheadline {
  font-size: 12.5px !important;
  color: rgba(255, 255, 255, 0.88) !important;
  line-height: 1.45 !important;
  max-width: 320px !important;
}

/* White Action Cards List */
.sh-hub-actions-card {
  position: relative !important;
  margin-top: -18px !important;
  border-top-left-radius: 24px !important;
  border-top-right-radius: 24px !important;
  background: #ffffff !important;
  padding: 16px 14px 20px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04) !important;
  flex: 1 !important;
}

/* Hub Action Row Item */
.sh-hub-item {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 12px 14px !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  border: 1px solid #f1f5f9 !important;
  cursor: pointer !important;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.sh-hub-item:hover {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
}

.sh-hub-item:active {
  transform: translateY(0) !important;
}

/* Icon Badges */
.sh-item-icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
}

.sh-icon-blue   { background: #2563eb !important; }
.sh-icon-orange { background: #ea580c !important; }
.sh-icon-purple { background: #7c3aed !important; }
.sh-icon-teal   { background: #0d9488 !important; }

.sh-item-icon svg {
  stroke: #ffffff !important;
}

.sh-item-text {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.sh-item-title-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.sh-item-title-row h4 {
  font-size: 14.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
}

.sh-item-title-row svg {
  width: 16px !important;
  height: 16px !important;
  stroke: #94a3b8 !important;
}

.sh-item-action-link {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #2563eb !important;
}

.sh-item-text p {
  font-size: 12px !important;
  color: #64748b !important;
  line-height: 1.35 !important;
}

/* ── 2. SUB-SCREEN HEADER & WRAPPER ── */
.sh-screen-wrapper {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  background: #ffffff !important;
  overflow: hidden !important;
}

.sh-sub-header {
  height: 64px !important;
  background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
  color: #ffffff !important;
  padding: 0 16px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.sh-sub-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.sh-back-btn {
  width: 32px !important;
  height: 32px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.16) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: background 0.15s !important;
}

.sh-back-btn:hover {
  background: rgba(255, 255, 255, 0.28) !important;
}

.sh-back-btn svg {
  width: 16px !important;
  height: 16px !important;
  stroke: #ffffff !important;
}

.sh-sub-title-group h3 {
  font-size: 14.5px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  line-height: 1.2 !important;
}

.sh-sub-title-group p {
  font-size: 11.5px !important;
  color: rgba(255, 255, 255, 0.85) !important;
}

.sh-sub-close-btn {
  width: 32px !important;
  height: 32px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.16) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: background 0.15s !important;
}

.sh-sub-close-btn:hover {
  background: rgba(255, 255, 255, 0.28) !important;
}

.sh-sub-close-btn svg {
  width: 16px !important;
  height: 16px !important;
  stroke: #ffffff !important;
}

.sh-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.sh-end-chat-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 5px 10px !important;
  background: rgba(239, 68, 68, 0.25) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  color: #ffffff !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
}

.sh-end-chat-btn:hover {
  background: rgba(239, 68, 68, 0.4) !important;
}

.sh-end-chat-btn svg {
  width: 14px !important;
  height: 14px !important;
  stroke: #ffffff !important;
}

/* ── 3. FORM BODY & INPUTS ── */
.sh-form-body-container {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 22px 20px 24px !important;
  background: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

.sh-item-active-pill {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #16a34a !important;
  background: #dcfce7 !important;
  padding: 2px 8px !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
}

.sh-form-fields {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  width: 100% !important;
}

.sh-form-row {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  width: 100% !important;
  margin: 0 !important;
}

.sh-label {
  display: flex !important;
  align-items: center !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #475569 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  line-height: 1.2 !important;
  margin: 0 !important;
}

.sh-star {
  color: #ef4444 !important;
  margin-left: 2px !important;
}

/* 2-Column Grid for Department & Priority */
.sh-fields-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  width: 100% !important;
  margin: 0 !important;
}

/* Input Styles */
.sh-input {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  padding: 0 14px !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #0f172a !important;
  outline: none !important;
  font-family: inherit !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03) !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

.sh-input:hover {
  border-color: #cbd5e1 !important;
}

.sh-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.sh-select {
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px 14px !important;
  padding-right: 36px !important;
}

/* Logged-In User Card */
.sh-user-card {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 14px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
}

.sh-user-avatar {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: #2563eb !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.sh-user-avatar svg {
  width: 16px !important;
  height: 16px !important;
  stroke: #ffffff !important;
}

.sh-user-meta {
  display: flex !important;
  flex-direction: column !important;
}

.sh-user-label {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  color: #64748b !important;
}

.sh-user-name {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

/* Rich Text Editor Box */
.sh-rich-editor-box {
  width: 100% !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  overflow: hidden !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03) !important;
  transition: all 0.15s ease !important;
  display: flex !important;
  flex-direction: column !important;
}

.sh-rich-editor-box:hover {
  border-color: #cbd5e1 !important;
}

.sh-rich-editor-box.sh-focused,
.sh-rich-editor-box:focus-within {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.sh-editor-toolbar {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 6px 10px !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.sh-editor-textarea {
  width: 100% !important;
  min-height: 96px !important;
  height: 96px !important;
  padding: 10px 14px !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  color: #0f172a !important;
  resize: vertical !important;
  line-height: 1.5 !important;
  box-shadow: none !important;
}

/* File Upload Zone */
.sh-upload-zone {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 14px !important;
  background: #f8fafc !important;
  border: 1.5px dashed #cbd5e1 !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.sh-upload-zone:hover,
.sh-upload-zone.sh-dragover {
  border-color: #2563eb !important;
  background: #eff6ff !important;
}

.sh-upload-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: #eff6ff !important;
  color: #2563eb !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  border: 1px solid #dbeafe !important;
}

.sh-upload-icon svg {
  width: 16px !important;
  height: 16px !important;
  stroke: #2563eb !important;
}

.sh-upload-text {
  display: flex !important;
  flex-direction: column !important;
}

.sh-upload-title {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
}

.sh-upload-sub {
  font-size: 11px !important;
  color: #64748b !important;
}

/* Primary Action Button */
.sh-primary-btn {
  width: 100% !important;
  height: 48px !important;
  background: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 12px !important;
  font-size: 14.5px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
  transition: all 0.15s ease !important;
  margin-top: 4px !important;
}

.sh-primary-btn:hover {
  background: #1d4ed8 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35) !important;
}

.sh-primary-btn:active {
  transform: translateY(0) !important;
}

.sh-primary-btn svg {
  stroke: #ffffff !important;
}

/* Ticket Success Confirmation Box */
.sh-ticket-success-box {
  margin: auto !important;
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 24px 10px !important;
}

.sh-success-icon-badge {
  width: 56px !important;
  height: 56px !important;
  border-radius: 50% !important;
  background: #10b981 !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 6px !important;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3) !important;
}

.sh-success-icon-badge svg {
  width: 28px !important;
  height: 28px !important;
  stroke: #ffffff !important;
  stroke-width: 2.8 !important;
}

/* ── 4. KNOWLEDGE BASE SEARCH & LIST ── */
.sh-kb-container {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 18px 18px 24px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  background: #ffffff !important;
}

.sh-chat-widget .sh-kb-search-box {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}

.sh-chat-widget .sh-kb-search-icon {
  position: absolute !important;
  left: 14px !important;
  color: #94a3b8 !important;
  display: flex !important;
  align-items: center !important;
}

.sh-chat-widget .sh-kb-search-icon svg {
  stroke: #94a3b8 !important;
}

.sh-chat-widget .sh-kb-search-input {
  padding-left: 38px !important;
  width: 100% !important;
}

.sh-kb-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.sh-kb-item {
  padding: 12px 14px !important;
  border-radius: 12px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
}

.sh-kb-item:hover {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
}

.sh-kb-item-title {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  margin-bottom: 2px !important;
}

.sh-kb-item-excerpt {
  font-size: 12px !important;
  color: #64748b !important;
}

.sh-kb-back-link {
  background: transparent !important;
  border: none !important;
  color: #2563eb !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin-bottom: 12px !important;
  text-align: left !important;
}

.sh-kb-article-title {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin-bottom: 12px !important;
}

.sh-kb-article-body {
  font-size: 13.5px !important;
  color: #334155 !important;
  line-height: 1.6 !important;
}

/* ── 5. MESSAGES FEED & ACTIVE CHAT ── */
.sh-messages-feed {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 16px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  background: #f8fafc !important;
}

.sh-empty-state {
  margin: auto !important;
  text-align: center !important;
  color: #94a3b8 !important;
  font-size: 13px !important;
  padding: 20px !important;
}

.sh-empty-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  background: #e2e8f0 !important;
  color: #64748b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto 8px !important;
}

.sh-message-row {
  display: flex !important;
  flex-direction: column !important;
  max-width: 84% !important;
  animation: sh-msg-anim 0.2s ease-out !important;
}

@keyframes sh-msg-anim {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sh-row-visitor { align-self: flex-end !important; }
.sh-row-agent   { align-self: flex-start !important; }

.sh-bubble {
  padding: 10px 14px !important;
  border-radius: 16px !important;
  font-size: 13.5px !important;
  line-height: 1.45 !important;
  word-break: break-word !important;
}

.sh-bubble-visitor {
  background: #2563eb !important;
  color: #ffffff !important;
  border-bottom-right-radius: 4px !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2) !important;
}

.sh-bubble-agent {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-bottom-left-radius: 4px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

.sh-bubble-text strong { font-weight: 700 !important; }
.sh-bubble-text em { font-style: italic !important; }
.sh-bubble-text code {
  font-family: monospace !important;
  font-size: 11.5px !important;
  background: rgba(0, 0, 0, 0.08) !important;
  padding: 2px 4px !important;
  border-radius: 4px !important;
}
.sh-bubble-visitor code { background: rgba(255, 255, 255, 0.2) !important; }

.sh-bubble-meta {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 4px !important;
  margin-top: 4px !important;
  font-size: 10.5px !important;
  opacity: 0.75 !important;
}

.sh-bubble-agent .sh-bubble-meta { justify-content: flex-start !important; }

/* Responsive Images & Media in Message Bubbles */
.sh-bubble img,
.sh-media-thumb,
.sh-bubble-attachments img,
.sh-bubble-text img {
  max-width: 100% !important;
  max-height: 220px !important;
  width: auto !important;
  height: auto !important;
  border-radius: 10px !important;
  object-fit: cover !important;
  display: block !important;
  margin: 6px 0 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  transition: transform 0.15s ease, opacity 0.15s ease !important;
}

.sh-bubble img:hover,
.sh-media-thumb:hover {
  opacity: 0.95 !important;
  transform: scale(1.01) !important;
}

.sh-bubble-attachments {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin-top: 6px !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.sh-bubble-file {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.sh-bubble-visitor .sh-bubble-file {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

.sh-bubble-visitor .sh-bubble-file:hover {
  background: rgba(255, 255, 255, 0.3) !important;
}

.sh-bubble-agent .sh-bubble-file {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border: 1px solid #e2e8f0 !important;
}

.sh-bubble-agent .sh-bubble-file:hover {
  background: #e2e8f0 !important;
}

.sh-msg-link {
  color: inherit !important;
  text-decoration: underline !important;
  font-weight: 600 !important;
}

.sh-bubble-visitor .sh-msg-link {
  color: #ffffff !important;
}

.sh-bubble-agent .sh-msg-link {
  color: #2563eb !important;
}

/* Active Chat Input Area */
.sh-active-input-box {
  border-top: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  padding: 10px 14px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
}

.sh-toolbar {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  padding-bottom: 4px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.sh-tool-btn {
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
}

.sh-tool-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.sh-tool-btn.sh-tool-btn-active {
  background: #eff6ff !important;
  color: #2563eb !important;
}

.sh-emoji-popover {
  display: flex !important;
  gap: 4px !important;
  padding: 8px 10px !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
}

.sh-emoji-item {
  background: transparent !important;
  border: none !important;
  font-size: 17px !important;
  cursor: pointer !important;
  padding: 4px 6px !important;
  border-radius: 6px !important;
  transition: transform 0.15s, background 0.15s !important;
}

.sh-emoji-item:hover {
  background: #e2e8f0 !important;
  transform: scale(1.2) !important;
}

/* Inline Link Modal */
.sh-inline-link-modal {
  padding: 10px 12px !important;
  background: #f1f5f9 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  animation: sh-link-fade 0.18s ease-out !important;
}

@keyframes sh-link-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sh-link-fields-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.sh-link-input {
  height: 34px !important;
  font-size: 12.5px !important;
  padding: 0 10px !important;
  background: #ffffff !important;
  border-radius: 8px !important;
}

.sh-link-modal-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin-top: 2px !important;
}

.sh-link-insert-btn {
  height: 30px !important;
  padding: 0 12px !important;
  background: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background 0.15s !important;
}

.sh-link-insert-btn:hover {
  background: #1d4ed8 !important;
}

.sh-link-cancel-btn {
  height: 30px !important;
  padding: 0 10px !important;
  background: transparent !important;
  color: #64748b !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  cursor: pointer !important;
}

.sh-link-cancel-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

.sh-input-bottom-row {
  display: flex !important;
  align-items: flex-end !important;
  gap: 8px !important;
}

.sh-active-textarea {
  flex: 1 !important;
  border: none !important;
  outline: none !important;
  font-size: 13.5px !important;
  font-family: inherit !important;
  color: #0f172a !important;
  resize: none !important;
  max-height: 80px !important;
  line-height: 1.4 !important;
  padding: 4px 0 !important;
}

.sh-send-btn {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  background: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3) !important;
}

.sh-send-btn:hover { background: #1d4ed8 !important; }

/* ── 6. CSAT RATING & FEEDBACK ── */
.sh-rating-container {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 24px 20px !important;
  background: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  text-align: center !important;
}

.sh-rating-intro {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
}

.sh-rating-badge-icon {
  font-size: 32px !important;
  margin-bottom: 4px !important;
}

.sh-rating-intro h3 {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

.sh-rating-intro p {
  font-size: 13px !important;
  color: #64748b !important;
}

.sh-stars-wrapper {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 12px 14px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
}

.sh-stars-row { display: flex !important; gap: 6px !important; }

.sh-star-btn {
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  padding: 4px !important;
  transition: transform 0.15s !important;
}

.sh-star-btn:hover { transform: scale(1.2) !important; }

.sh-star-btn svg {
  width: 28px !important;
  height: 28px !important;
  stroke: #cbd5e1 !important;
  fill: #f1f5f9 !important;
}

.sh-star-btn.sh-star-active svg {
  stroke: #f59e0b !important;
  fill: #fbbf24 !important;
}

.sh-rating-score-label {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #d97706 !important;
}

.sh-rating-tags-box {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  text-align: left !important;
}

.sh-tags-title {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #475569 !important;
}

.sh-tags-row { display: flex !important; flex-wrap: wrap !important; gap: 6px !important; }

.sh-tag-pill {
  padding: 6px 12px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
}

.sh-tag-pill:hover {
  border-color: #2563eb !important;
  color: #2563eb !important;
  background: #eff6ff !important;
}

.sh-tag-pill.sh-tag-selected {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
}

.sh-textarea-rating {
  height: 72px !important;
  padding: 8px 12px !important;
  resize: vertical !important;
}

.sh-rating-actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  align-items: center !important;
}

.sh-skip-link {
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
  font-size: 12.5px !important;
  cursor: pointer !important;
  text-decoration: underline !important;
}

.sh-rating-thankyou {
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 24px 10px !important;
}

.sh-thankyou-icon {
  font-size: 42px !important;
  margin-bottom: 4px !important;
}

/* ── Unread Floating Badge ── */
.sh-unread-badge {
  position: absolute !important;
  top: -4px !important;
  right: -4px !important;
  background: #ef4444 !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  height: 22px !important;
  min-width: 22px !important;
  padding: 0 6px !important;
  border-radius: 9999px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
  animation: sh-badge-pop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes sh-badge-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ── Typing Indicator Wave ── */
.sh-typing-indicator-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 4px 16px 8px !important;
  animation: sh-fade-in 0.2s ease-out !important;
}

.sh-typing-bubble {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  background: #e2e8f0 !important;
  padding: 6px 10px !important;
  border-radius: 12px !important;
  border-bottom-left-radius: 2px !important;
}

.sh-typing-dot {
  width: 6px !important;
  height: 6px !important;
  background: #64748b !important;
  border-radius: 50% !important;
  display: inline-block !important;
  animation: sh-dot-bounce 1.3s infinite ease-in-out !important;
}

.sh-typing-dot:nth-child(1) { animation-delay: -0.32s !important; }
.sh-typing-dot:nth-child(2) { animation-delay: -0.16s !important; }

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

.sh-typing-text {
  font-size: 11px !important;
  color: #64748b !important;
  font-style: italic !important;
}

/* ── Mobile Responsive ── */
@media (max-width: 480px) {
  #sh-widget-panel,
  .sh-widget-panel {
    bottom: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    border: none !important;
  }
}
