:root {
  --livechat-accent: #2563eb;
  --livechat-accent-rgb: 37, 99, 235;
  --livechat-panel-bg: #f8fafc;
  --livechat-panel-header-bg: rgba(255, 255, 255, 0.94);
  --livechat-panel-border: rgba(15, 23, 42, 0.14);
  --livechat-panel-text: #0f172a;
  --livechat-panel-text-dim: #64748b;
  --livechat-block-bg: rgba(255, 255, 255, 0.78);
  --livechat-block-border: rgba(15, 23, 42, 0.12);
  --livechat-chip-bg: rgba(255, 255, 255, 0.9);
  --livechat-chip-border: rgba(15, 23, 42, 0.14);
  --livechat-chip-text: #334155;
  --livechat-input-bg: #ffffff;
  --livechat-input-border: rgba(15, 23, 42, 0.16);
  --livechat-input-text: #0f172a;
  --livechat-input-placeholder: #94a3b8;
  --livechat-success-bg: rgba(34, 197, 94, 0.12);
  --livechat-success-border: rgba(34, 197, 94, 0.32);
  --livechat-success-text: #166534;
  --livechat-scroll-thumb: rgba(100, 116, 139, 0.48);
  --livechat-scroll-thumb-hover: rgba(71, 85, 105, 0.68);
  --livechat-scroll-track: rgba(148, 163, 184, 0.08);
}

:root[data-bs-theme="dark"] {
  --livechat-accent: #2f6df6;
  --livechat-accent-rgb: 47, 109, 246;
  --livechat-panel-bg: linear-gradient(180deg, rgba(16, 20, 26, 0.98), rgba(13, 17, 22, 0.98));
  --livechat-panel-header-bg: rgba(14, 18, 24, 0.94);
  --livechat-panel-border: rgba(148, 163, 184, 0.2);
  --livechat-panel-text: var(--app-text, #e8edf7);
  --livechat-panel-text-dim: var(--app-text-muted, #a4b0c4);
  --livechat-block-bg: rgba(36, 42, 51, 0.76);
  --livechat-block-border: rgba(148, 163, 184, 0.24);
  --livechat-chip-bg: rgba(19, 24, 31, 0.78);
  --livechat-chip-border: rgba(148, 163, 184, 0.3);
  --livechat-chip-text: #d5e0f5;
  --livechat-input-bg: rgba(20, 23, 28, 0.86);
  --livechat-input-border: rgba(148, 163, 184, 0.28);
  --livechat-input-text: var(--app-text, #e8edf7);
  --livechat-input-placeholder: #8ea0bb;
  --livechat-success-bg: rgba(34, 197, 94, 0.14);
  --livechat-success-border: rgba(34, 197, 94, 0.34);
  --livechat-success-text: #8ee6ae;
  --livechat-scroll-thumb: rgba(148, 163, 184, 0.42);
  --livechat-scroll-thumb-hover: rgba(186, 199, 218, 0.62);
  --livechat-scroll-track: rgba(15, 23, 42, 0.26);
}

.livechat-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 1080;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #ffffff;
  background: linear-gradient(130deg, #2563eb, #0ea5e9);
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.34);
  transition: transform 0.15s ease, filter 0.2s ease;
}

.livechat-fab-icon {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.livechat-fab .fab-icon-chat {
  opacity: 1;
  transform: scale(1);
}

.livechat-fab .fab-icon-inbox {
  opacity: 0;
  transform: scale(0.84);
}

.livechat-fab-unread-dot {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fb7185, #f97316);
  box-shadow: 0 0 0 3px rgba(2, 6, 23, 0.42), 0 0 18px rgba(249, 115, 22, 0.42);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.livechat-fab.has-unread .livechat-fab-unread-dot {
  opacity: 1;
  transform: scale(1);
  animation: livechat-fab-unread-pulse 1.6s ease-in-out infinite;
}

.livechat-fab.has-unread .fab-icon-chat {
  animation: livechat-fab-chat-swap 1.9s infinite;
}

.livechat-fab.has-unread .fab-icon-inbox {
  animation: livechat-fab-inbox-swap 1.9s infinite;
}

@keyframes livechat-fab-chat-swap {
  0%,
  44% {
    opacity: 1;
    transform: scale(1);
  }
  56%,
  100% {
    opacity: 0;
    transform: scale(0.84);
  }
}

@keyframes livechat-fab-inbox-swap {
  0%,
  44% {
    opacity: 0;
    transform: scale(0.84);
  }
  56%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes livechat-fab-unread-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(2, 6, 23, 0.42), 0 0 18px rgba(249, 115, 22, 0.42);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(2, 6, 23, 0.46), 0 0 26px rgba(251, 113, 133, 0.56);
  }
}

.livechat-panel-open .livechat-fab {
  opacity: 0;
  transform: scale(0.92) translateY(8px);
  pointer-events: none;
}

.livechat-fab:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.livechat-fab:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.livechat-public-panel {
  width: min(420px, 100vw);
  color: var(--livechat-panel-text);
  background: var(--livechat-panel-bg);
  z-index: 1110;
  box-shadow: -20px 0 44px rgba(2, 6, 23, 0.22), -5px 0 14px rgba(2, 6, 23, 0.14);
}

.livechat-public-panel.offcanvas-end {
  border-left: 0 !important;
  border-top-left-radius: 15px !important;
  border-bottom-left-radius:15px !important;
  overflow: hidden;
}

:root[data-bs-theme="dark"] .livechat-public-panel {
  box-shadow: -22px 0 48px rgba(2, 6, 23, 0.48), -6px 0 16px rgba(2, 6, 23, 0.3);
}

.offcanvas-backdrop.livechat-backdrop {
  z-index: 1105;
}

.livechat-public-panel .offcanvas-body {
  background: transparent;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  scroll-padding-bottom: 9rem;
}

.livechat-public-panel .offcanvas-title {
  color: var(--livechat-panel-text);
}

.livechat-public-panel .offcanvas-header .text-muted {
  color: var(--livechat-panel-text-dim) !important;
}

.livechat-public-panel .btn-close {
  opacity: 0.78;
}

:root[data-bs-theme="dark"] .livechat-public-panel .btn-close {
  filter: invert(1) grayscale(1) brightness(1.4);
  opacity: 0.82;
}

.livechat-public-panel .offcanvas-header {
  border-bottom: 1px solid var(--livechat-panel-border);
  background: var(--livechat-panel-header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding-top: max(0.9rem, env(safe-area-inset-top));
}

.livechat-public-msg {
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  font-size: 0.93rem;
  line-height: 1.45;
  width: fit-content;
  max-width: 84%;
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.14);
}

.livechat-public-msg-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.74rem;
  color: var(--livechat-panel-text-dim);
}

.livechat-public-msg-meta > span:last-child {
  min-width: 64px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.livechat-public-msg-system {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.livechat-public-msg-customer {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  align-self: flex-end;
  border-radius: 14px 14px 0px 14px;
}

.livechat-public-msg-agent {
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.3);
  align-self: flex-start;
  border-radius: 14px 14px 14px 0px;
}

.livechat-public-msg-ai-assist {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.5);
  align-self: flex-start;
  border-radius: 14px 14px 14px 0px;
}

.livechat-public-msg-ai-assist .livechat-public-msg-meta {
  color: #facc15;
  font-weight: 700;
}

.livechat-public-msg-system {
  align-self: center;
  max-width: 96%;
}

.livechat-intake-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100%;
}

.livechat-intake-block {
  border: 1px solid var(--livechat-block-border);
  border-radius: 12px;
  background: var(--livechat-block-bg);
  padding: 0.75rem 0.8rem;
  scroll-margin-bottom: 9rem;
}

.livechat-intake-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--livechat-panel-text);
}

.livechat-topic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.livechat-topic-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--livechat-chip-border);
  border-radius: 999px;
  background: var(--livechat-chip-bg);
  padding: 0.42rem 0.65rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--livechat-chip-text);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.livechat-topic-chip:hover {
  border-color: rgba(var(--livechat-accent-rgb), 0.5);
  background: color-mix(in srgb, var(--livechat-chip-bg) 78%, var(--livechat-accent) 22%);
}

.livechat-topic-chip input[type="radio"] {
  margin: 0;
  accent-color: var(--livechat-accent);
}

.livechat-public-panel .form-label {
  color: var(--livechat-panel-text);
  font-weight: 700;
}

.livechat-public-panel .form-control {
  background: var(--livechat-input-bg);
  border: 1px solid var(--livechat-input-border);
  color: var(--livechat-input-text);
}

.livechat-public-panel .form-control::placeholder {
  color: var(--livechat-input-placeholder);
}

.livechat-public-panel .form-control:focus {
  background: var(--livechat-input-bg);
  color: var(--livechat-input-text);
  border-color: rgba(var(--livechat-accent-rgb), 0.75);
  box-shadow: 0 0 0 0.22rem rgba(var(--livechat-accent-rgb), 0.22);
}

.livechat-public-panel .small.text-muted {
  color: var(--livechat-panel-text-dim) !important;
}

.livechat-public-panel a {
  color: color-mix(in srgb, var(--livechat-accent) 82%, #ffffff 18%);
}

.livechat-success-shell {
  border-radius: 14px;
  border: 1px solid var(--livechat-success-border);
  background: var(--livechat-success-bg);
  padding: 0.9rem 1rem;
}

.livechat-success-title {
  font-weight: 800;
  color: var(--livechat-success-text);
}

.livechat-public-alert-slot {
  width: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.livechat-public-alert-slot.is-visible {
  display: flex;
}

.livechat-public-chat-stack {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 12px;
  padding-top: 8px;
}

.livechat-public-alert-slot-top {
  display: flex;
  height: 0;
  overflow: visible;
  margin-top: 0;
  margin-bottom: 0;
  position: absolute;
  left: 50%;
  width: calc(100% - 1.5rem);
  max-width: calc(100% - 1.5rem);
  transform: translateX(-50%);
  top: 14px;
  z-index: 32;
  pointer-events: none;
  justify-content: center;
}

.livechat-public-alert-slot-top .livechat-inline-toast {
  transform: none;
  margin: 0;
  max-width: min(94%, 360px);
  box-shadow: 0 8px 22px rgba(2, 6, 23, 0.24);
  pointer-events: auto;
  justify-content: center;
}

.livechat-public-alert-slot-top:not(.is-visible) .livechat-inline-toast {
  display: none !important;
}

.livechat-inline-toast {
  border: 1px solid color-mix(in srgb, var(--livechat-success-border) 62%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--livechat-success-bg) 48%, transparent);
  color: var(--livechat-success-text);
  padding: 0.34rem 0.56rem;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
}

.livechat-inline-toast-state {
  max-width: calc(100% - 4px);
}

.livechat-inline-toast-warning {
  border-color: rgba(245, 158, 11, 0.38);
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.livechat-inline-toast-danger {
  border-color: rgba(239, 68, 68, 0.36);
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.livechat-inline-toast-new {
  border-color: rgba(var(--livechat-accent-rgb), 0.35);
  background: rgba(var(--livechat-accent-rgb), 0.12);
  color: color-mix(in srgb, var(--livechat-accent) 80%, #ffffff 20%);
  cursor: pointer;
}

.livechat-inline-toast-new:hover {
  border-color: rgba(var(--livechat-accent-rgb), 0.52);
  background: rgba(var(--livechat-accent-rgb), 0.2);
}

:root[data-bs-theme="dark"] .livechat-inline-toast-warning {
  color: #facc15;
}

:root[data-bs-theme="dark"] .livechat-inline-toast-danger {
  color: #fca5a5;
}

:root[data-bs-theme="dark"] .livechat-inline-toast-new {
  color: #b6d4ff;
}

.livechat-public-panel .offcanvas-body > * {
  min-width: 0;
}

.livechat-public-body {
  position: relative;
  min-height: 100%;
}

.livechat-intake-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: auto;
  padding-top: 0.8rem;
  padding-bottom: calc(0.15rem + env(safe-area-inset-bottom));
  background:
    linear-gradient(
      180deg,
      transparent 0%,
      color-mix(in srgb, var(--livechat-panel-bg) 78%, transparent) 30%,
      var(--livechat-panel-bg) 100%
    );
}

.livechat-intake-privacy-note {
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--livechat-panel-text-dim);
}

.livechat-intake-privacy-note a {
  font-weight: 700;
  text-underline-offset: 2px;
}

.livechat-public-thread-shell {
  border: 1px solid var(--livechat-block-border);
  border-radius: 12px;
  background: var(--livechat-block-bg);
  padding: 0.7rem 0.75rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 200px;
  position: relative;
  z-index: 1;
}

.livechat-public-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 0.1rem;
}

.livechat-public-thread-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.livechat-public-thread-new-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.livechat-public-thread-new-badge i {
  font-size: 0.82rem;
}

.livechat-public-thread-id {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--livechat-panel-text);
  letter-spacing: 0.01em;
}

.livechat-public-thread-head .status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.14);
  color: var(--livechat-panel-text-dim);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.34rem 0.62rem;
  white-space: nowrap;
}

.livechat-public-thread-head .status-chip.state-resolved {
  border-color: rgba(34, 197, 94, 0.36);
  background: rgba(34, 197, 94, 0.2);
  color: rgba(22, 101, 52, 0.96);
}

.livechat-public-thread-head .status-chip.state-active {
  border-color: rgba(59, 130, 246, 0.34);
  background: rgba(59, 130, 246, 0.16);
  color: rgba(29, 78, 216, 0.96);
}

.livechat-public-thread-head .status-chip.state-waiting {
  border-color: rgba(245, 158, 11, 0.34);
  background: rgba(245, 158, 11, 0.17);
  color: rgba(120, 53, 15, 0.96);
}

.livechat-public-thread-head .status-chip.state-bot_only {
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(148, 163, 184, 0.16);
  color: rgba(51, 65, 85, 0.94);
}

:root[data-bs-theme="dark"] .livechat-public-thread-head .status-chip.state-resolved {
  border-color: rgba(34, 197, 94, 0.34);
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

:root[data-bs-theme="dark"] .livechat-public-thread-head .status-chip.state-active {
  border-color: rgba(59, 130, 246, 0.34);
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

:root[data-bs-theme="dark"] .livechat-public-thread-head .status-chip.state-waiting {
  border-color: rgba(245, 158, 11, 0.34);
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

:root[data-bs-theme="dark"] .livechat-public-thread-head .status-chip.state-bot_only {
  border-color: rgba(148, 163, 184, 0.32);
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.livechat-public-thread-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--livechat-chip-border);
  border-radius: 999px;
  background: var(--livechat-chip-bg);
  color: var(--livechat-panel-text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.22rem 0.5rem;
  text-decoration: none;
}

.livechat-public-thread-toggle:hover {
  color: var(--livechat-panel-text);
  border-color: rgba(var(--livechat-accent-rgb), 0.55);
  background: color-mix(in srgb, var(--livechat-chip-bg) 76%, var(--livechat-accent) 24%);
}

.livechat-public-thread-toggle:focus-visible {
  outline: 2px solid rgba(var(--livechat-accent-rgb), 0.46);
  outline-offset: 2px;
}

.livechat-public-thread-toggle i {
  transition: transform 0.18s ease;
}

.livechat-public-thread-toggle.is-open i {
  transform: rotate(180deg);
}

.livechat-public-thread-list {
  max-height: min(48vh, 420px);
  overflow: auto;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.livechat-public-thread-shell.livechat-thread-collapsed {
  flex: 0 0 auto;
  min-height: 0;
  padding-bottom: 0.55rem;
}

.livechat-public-thread-shell.livechat-thread-collapsed .livechat-public-thread-list {
  display: none;
}

.livechat-public-thread-shell.livechat-thread-collapsed .livechat-public-thread-head {
  margin-bottom: 0;
}

.livechat-public-availability-card {
  border: 1px solid color-mix(in srgb, rgba(148, 163, 184, 0.38) 68%, var(--livechat-block-border));
  border-radius: 12px;
  background: color-mix(in srgb, rgba(148, 163, 184, 0.12) 42%, var(--livechat-block-bg));
  padding: 0.62rem 0.7rem;
}

.livechat-public-availability-card.is-ai-mode {
  border-color: color-mix(in srgb, rgba(14, 165, 233, 0.56) 72%, var(--livechat-block-border));
  background: color-mix(in srgb, rgba(14, 165, 233, 0.14) 44%, var(--livechat-block-bg));
}

.livechat-public-availability-card.is-human-queue {
  border-color: color-mix(in srgb, rgba(245, 158, 11, 0.46) 72%, var(--livechat-block-border));
  background: color-mix(in srgb, rgba(245, 158, 11, 0.13) 42%, var(--livechat-block-bg));
}

.livechat-public-availability-title {
  font-size: 0.83rem;
  font-weight: 800;
  color: var(--livechat-panel-text);
}

.livechat-public-availability-body {
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--livechat-panel-text-dim);
}

.livechat-public-csat-card {
  border: 1px solid color-mix(in srgb, var(--livechat-success-border) 62%, var(--livechat-block-border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--livechat-success-bg) 30%, var(--livechat-block-bg) 70%);
  padding: 0.6rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.livechat-public-csat-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.livechat-public-csat-head strong {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--livechat-panel-text);
}

.livechat-public-csat-head span {
  font-size: 0.74rem;
  color: var(--livechat-panel-text-dim);
}

.livechat-public-csat-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.livechat-csat-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--livechat-chip-border);
  border-radius: 999px;
  background: var(--livechat-chip-bg);
  cursor: pointer;
  min-height: 34px;
}

.livechat-csat-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.livechat-csat-pill span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--livechat-chip-text);
}

.livechat-csat-pill:has(input:checked) {
  border-color: rgba(var(--livechat-accent-rgb), 0.72);
  background: rgba(var(--livechat-accent-rgb), 0.2);
}

.livechat-csat-pill:has(input:checked) span {
  color: color-mix(in srgb, var(--livechat-accent) 82%, #ffffff 18%);
}

.livechat-public-csat-scale-hint {
  font-size: 0.72rem;
  color: var(--livechat-panel-text-dim);
}

.livechat-public-csat-thanks {
  border: 1px dashed color-mix(in srgb, var(--livechat-block-border) 88%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--livechat-block-bg) 72%, transparent);
  padding: 0.7rem 0.72rem;
}

.livechat-public-csat-thanks-success {
  border-color: color-mix(in srgb, rgba(34, 197, 94, 0.55) 72%, var(--livechat-block-border));
  background: color-mix(in srgb, rgba(34, 197, 94, 0.16) 44%, var(--livechat-block-bg));
}

.livechat-public-csat-thanks-info {
  border-color: color-mix(in srgb, rgba(var(--livechat-accent-rgb), 0.62) 72%, var(--livechat-block-border));
  background: color-mix(in srgb, rgba(var(--livechat-accent-rgb), 0.16) 42%, var(--livechat-block-bg));
}

.livechat-public-csat-thanks-warning {
  border-color: color-mix(in srgb, rgba(245, 158, 11, 0.58) 72%, var(--livechat-block-border));
  background: color-mix(in srgb, rgba(245, 158, 11, 0.15) 44%, var(--livechat-block-bg));
}

.livechat-public-csat-thanks-urgent {
  border-color: color-mix(in srgb, rgba(239, 68, 68, 0.62) 72%, var(--livechat-block-border));
  background: color-mix(in srgb, rgba(239, 68, 68, 0.14) 46%, var(--livechat-block-bg));
}

.livechat-public-csat-thanks-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--livechat-panel-text);
}

.livechat-public-csat-thanks-sub {
  font-size: 0.78rem;
  color: var(--livechat-panel-text-dim);
}

.livechat-public-csat-escalation {
  margin-top: 0.5rem;
  font-size: 0.76rem;
  line-height: 1.38;
  color: var(--livechat-panel-text);
}

.livechat-public-csat-escalation a {
  color: color-mix(in srgb, var(--livechat-accent) 86%, #ffffff 14%);
  text-underline-offset: 2px;
}

.livechat-public-mini-close-btn {
  width: 48%;
  min-width: 160px;
  align-self: center;
  border-radius: 999px;
}

.livechat-public-composer {
  border: 1px solid var(--livechat-block-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--livechat-block-bg) 86%, transparent);
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.livechat-public-composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.livechat-public-composer-hint {
  font-size: 0.72rem;
  color: var(--livechat-panel-text-dim);
}

.livechat-public-composer-box {
  border: 1px solid var(--livechat-input-border);
  border-radius: 12px;
  background: var(--livechat-input-bg);
  padding: 2px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.livechat-public-composer .form-control {
  min-height: 82px;
  resize: none;
  border: 0;
  box-shadow: none !important;
}

.livechat-public-composer .form-control:focus {
  border: 0;
}

.livechat-public-send-btn {
  font-weight: 700;
}

.livechat-public-composer-box:focus-within {
  border-color: rgba(var(--livechat-accent-rgb), 0.75);
  box-shadow: 0 0 0 0.18rem rgba(var(--livechat-accent-rgb), 0.18);
}

.livechat-public-composer-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.livechat-public-close-btn {
  border-color: var(--livechat-input-border);
  color: var(--livechat-panel-text);
}

.livechat-public-close-btn:hover {
  border-color: rgba(var(--livechat-accent-rgb), 0.55);
  background: rgba(var(--livechat-accent-rgb), 0.14);
  color: var(--livechat-panel-text);
}

.livechat-public-close-note {
  font-size: 0.74rem;
  color: var(--livechat-panel-text-dim);
  text-align: center;
  line-height: 1.35;
}

.livechat-launcher-card {
  max-width: 920px;
  margin: 0 auto;
  border-radius: 20px;
  border: 1px solid var(--border);
  background:
    radial-gradient(520px 230px at 4% -12%, rgba(37, 99, 235, 0.14), transparent 62%),
    radial-gradient(580px 220px at 98% 112%, rgba(14, 165, 233, 0.11), transparent 66%),
    var(--card-strong);
  box-shadow: var(--shadow);
  padding: clamp(1.1rem, 1.6vw, 1.55rem);
}

.livechat-launcher-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--primary);
}

.livechat-launcher-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.livechat-launcher-sub {
  margin: 0;
  color: var(--text-dim);
  max-width: 72ch;
}

.livechat-launcher-todos {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.72);
  padding: 0.85rem 0.95rem;
}

.livechat-workspace {
  display: grid;
  grid-template-columns: minmax(250px, 0.95fr) minmax(420px, 1.55fr) minmax(250px, 1fr);
  gap: 12px;
}

.livechat-pane-shell {
  display: flex;
  flex-direction: column;
  min-height: 560px;
  border: 1px solid var(--staff-border);
  border-radius: 18px;
  background: var(--staff-surface);
  box-shadow: var(--staff-shadow-soft);
  overflow: hidden;
}

.livechat-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--staff-border) 90%, transparent);
  background: color-mix(in srgb, var(--staff-surface-strong) 78%, transparent);
}

.livechat-pane-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--staff-text);
}

.livechat-pane-subtitle {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: var(--staff-text-dim);
}

.livechat-pane-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  overflow: auto;
}

.livechat-pane-foot {
  border-top: 1px solid color-mix(in srgb, var(--staff-border) 90%, transparent);
  padding: 12px 14px;
  background: color-mix(in srgb, var(--staff-surface-strong) 74%, transparent);
}

.livechat-queue-item {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--staff-border) 86%, transparent);
  padding: 10px 11px;
  background: color-mix(in srgb, var(--staff-surface-strong) 70%, transparent);
}

.livechat-queue-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.livechat-queue-snippet {
  color: var(--staff-text-dim);
  font-size: 0.82rem;
}

.livechat-thread-body {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--staff-surface-strong) 60%, transparent),
      color-mix(in srgb, var(--staff-surface) 100%, transparent)
    );
}

.livechat-msg {
  max-width: 92%;
  border-radius: 12px;
  padding: 9px 11px;
  border: 1px solid transparent;
}

.livechat-msg-agent {
  align-self: flex-end;
  background: rgba(var(--staff-accent-rgb), 0.12);
  border-color: rgba(var(--staff-accent-rgb), 0.3);
}

.livechat-msg-customer {
  align-self: flex-start;
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.25);
}

.livechat-msg-system {
  align-self: center;
  width: 100%;
  background: color-mix(in srgb, var(--staff-surface-strong) 72%, transparent);
  border-color: color-mix(in srgb, var(--staff-border) 82%, transparent);
}

.livechat-context-card {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--staff-border) 86%, transparent);
  background: color-mix(in srgb, var(--staff-surface-strong) 72%, transparent);
  padding: 10px 11px;
}

.livechat-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.livechat-context-grid-item {
  border: 1px solid color-mix(in srgb, var(--staff-border) 84%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--staff-surface) 88%, transparent);
  padding: 8px 9px;
}

.livechat-deposit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.livechat-deposit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--staff-border) 84%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--staff-surface) 90%, transparent);
  padding: 7px 8px;
}

.livechat-ai-hooks-scroll {
  max-height: 168px;
  overflow: auto;
  padding-right: 3px;
}

.livechat-context-label {
  margin: 0 0 7px;
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--staff-text-dim);
  font-weight: 700;
}

.livechat-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.livechat-shift-toggle-form {
  margin-top: 10px;
}

.livechat-shift-toggle-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  font-weight: 700;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--staff-border) 82%, transparent);
  background: color-mix(in srgb, var(--staff-surface-strong) 78%, transparent);
  color: var(--staff-text);
  min-width: 320px;
  padding: 0.6rem 0.82rem;
}

.livechat-shift-toggle-btn.is-on {
  border-color: rgba(34, 197, 94, 0.44);
  background: rgba(34, 197, 94, 0.13);
  color: color-mix(in srgb, var(--staff-text) 86%, #166534);
}

.livechat-shift-toggle-btn.is-off {
  border-color: rgba(148, 163, 184, 0.34);
  background: color-mix(in srgb, var(--staff-surface-strong) 90%, rgba(148, 163, 184, 0.14));
  color: var(--staff-text);
}

.livechat-shift-toggle-btn:hover {
  color: var(--staff-text);
  border-color: color-mix(in srgb, var(--staff-accent) 45%, var(--staff-border));
}

.livechat-shift-toggle-title {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
}

.livechat-shift-toggle-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--staff-text-dim);
  line-height: 1.25;
}

.livechat-ai-shift-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-color: rgba(59, 130, 246, 0.36);
  background: color-mix(in srgb, rgba(59, 130, 246, 0.14) 72%, var(--staff-surface-strong));
}

.livechat-priority-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.livechat-priority-item {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--staff-border) 84%, transparent);
  background: color-mix(in srgb, var(--staff-surface-strong) 72%, transparent);
  padding: 10px 11px;
}

.status-chip.livechat-stage-chip {
  margin-top: 2px;
}

.status-chip.livechat-stage-chip.stage-client {
  border-color: rgba(34, 197, 94, 0.36);
  background: rgba(34, 197, 94, 0.16);
  color: rgba(21, 128, 61, 0.96);
}

.status-chip.livechat-stage-chip.stage-lead {
  border-color: rgba(59, 130, 246, 0.36);
  background: rgba(59, 130, 246, 0.16);
  color: rgba(30, 64, 175, 0.96);
}

.status-chip.livechat-stage-chip.stage-registered {
  border-color: rgba(14, 165, 233, 0.36);
  background: rgba(14, 165, 233, 0.16);
  color: rgba(3, 105, 161, 0.96);
}

.status-chip.livechat-stage-chip.stage-contact,
.status-chip.livechat-stage-chip.stage-visitor {
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(148, 163, 184, 0.14);
  color: var(--staff-text-dim);
}

:root[data-bs-theme="dark"] .status-chip.livechat-stage-chip.stage-client {
  border-color: rgba(74, 222, 128, 0.38);
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

:root[data-bs-theme="dark"] .status-chip.livechat-stage-chip.stage-lead {
  border-color: rgba(96, 165, 250, 0.38);
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

:root[data-bs-theme="dark"] .status-chip.livechat-stage-chip.stage-registered {
  border-color: rgba(125, 211, 252, 0.38);
  background: rgba(14, 165, 233, 0.2);
  color: #bae6fd;
}

:root[data-bs-theme="dark"] .status-chip.livechat-stage-chip.stage-contact,
:root[data-bs-theme="dark"] .status-chip.livechat-stage-chip.stage-visitor {
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.livechat-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--staff-border) 84%, transparent);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--staff-text);
  background: color-mix(in srgb, var(--staff-surface-strong) 72%, transparent);
}

.livechat-tab:hover {
  color: var(--staff-accent);
  border-color: color-mix(in srgb, var(--staff-accent) 36%, var(--staff-border));
}

.livechat-tab.is-active {
  color: var(--staff-accent);
  border-color: color-mix(in srgb, var(--staff-accent) 45%, var(--staff-border));
  background: color-mix(in srgb, var(--staff-accent) 12%, transparent);
}

.livechat-tab-count {
  font-size: 0.78rem;
  color: var(--staff-text-dim);
}

.livechat-sla-strip {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.livechat-sla-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.14);
  color: rgba(71, 85, 105, 0.98);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 6px 11px;
  white-space: nowrap;
}

.livechat-sla-pill.state-ok {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.16);
  color: rgba(22, 101, 52, 0.98);
}

.livechat-sla-pill.state-watch {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.18);
  color: rgba(120, 53, 15, 0.98);
}

.livechat-sla-pill.state-late {
  border-color: rgba(239, 68, 68, 0.26);
  background: rgba(239, 68, 68, 0.12);
  color: rgba(185, 28, 28, 0.98);
}

.livechat-inbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.livechat-inbox-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.livechat-inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.livechat-inline-form .form-select {
  min-width: 96px;
}

.livechat-inbox-toolbar-form {
  display: grid;
  gap: 6px;
}

.livechat-toolbar-label {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--staff-text-dim);
}

.livechat-inbox-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--staff-border) 84%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--staff-surface-strong) 74%, transparent);
}

.livechat-inbox-toolbar-group .form-select {
  min-width: 92px;
  border-radius: 10px;
}

.livechat-inbox-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.livechat-toolbar-btn,
.livechat-toolbar-btn-ghost,
.livechat-toolbar-btn-primary {
  border-radius: 10px;
  font-weight: 700;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.livechat-toolbar-btn {
  border: 1px solid color-mix(in srgb, var(--staff-accent) 42%, var(--staff-border));
  background: color-mix(in srgb, var(--staff-accent) 18%, var(--staff-surface-strong));
  color: var(--staff-text);
}

.livechat-toolbar-btn:hover {
  border-color: color-mix(in srgb, var(--staff-accent) 58%, var(--staff-border));
  color: var(--staff-text);
}

.livechat-toolbar-btn-ghost {
  border: 1px solid color-mix(in srgb, var(--staff-border) 90%, transparent);
  background: color-mix(in srgb, var(--staff-surface-strong) 74%, transparent);
  color: var(--staff-text-dim);
}

.livechat-toolbar-btn-primary {
  border: 1px solid color-mix(in srgb, var(--staff-primary) 54%, var(--staff-border));
  background: color-mix(in srgb, var(--staff-primary) 20%, var(--staff-surface-strong));
  color: var(--staff-text);
}

.livechat-standard-badge {
  display: inline-flex;
  align-items: center;
  border: 1px dashed color-mix(in srgb, var(--staff-border) 86%, transparent);
  border-radius: 999px;
  padding: 0.36rem 0.62rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--staff-text-dim);
  background: color-mix(in srgb, var(--staff-surface-strong) 74%, transparent);
}

.livechat-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.livechat-card-pagination .tgx-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.livechat-card-pagination .tgx-pagination li {
  display: flex;
  align-items: center;
}

.livechat-card-pagination .tgx-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--staff-border) 88%, transparent);
  background: color-mix(in srgb, var(--staff-surface-strong) 72%, transparent);
  color: var(--staff-text-dim);
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.livechat-card-pagination .tgx-page:hover {
  border-color: color-mix(in srgb, var(--staff-accent) 50%, var(--staff-border));
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.16);
  transform: translateY(-1px);
  color: var(--staff-text);
  text-decoration: none;
}

.livechat-card-pagination .tgx-pagination .is-active .tgx-page {
  background: color-mix(in srgb, var(--staff-accent) 18%, var(--staff-surface-strong));
  border-color: color-mix(in srgb, var(--staff-accent) 45%, var(--staff-border));
  color: var(--staff-text);
}

.livechat-card-pagination .tgx-pagination .is-disabled .tgx-page {
  opacity: 0.45;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

.livechat-card-pagination .tgx-pagination .is-ellipsis .tgx-ellipsis {
  min-width: 28px;
  padding: 0 8px;
  border: 1px dashed color-mix(in srgb, var(--staff-border) 88%, transparent);
  background: color-mix(in srgb, var(--staff-surface-strong) 70%, transparent);
}

.livechat-inbox-item {
  border: 1px solid color-mix(in srgb, var(--staff-border) 84%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--staff-surface-strong) 72%, transparent);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.livechat-inbox-item:hover {
  border-color: color-mix(in srgb, var(--staff-accent) 40%, var(--staff-border));
  color: inherit;
}

.livechat-inbox-main {
  min-width: 0;
}

.livechat-inbox-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.livechat-inbox-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.livechat-inbox-preview {
  color: var(--staff-text-dim);
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.livechat-inbox-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 120px;
}

.livechat-thread-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  scrollbar-gutter: stable;
  border: 1px solid color-mix(in srgb, var(--staff-border) 82%, transparent);
  border-radius: 12px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--staff-surface-strong) 78%, transparent),
      color-mix(in srgb, var(--staff-surface) 100%, transparent)
    );
  padding: 10px;
}

.livechat-thread-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.livechat-new-msg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(59, 130, 246, 0.42);
  background: rgba(59, 130, 246, 0.2);
  color: #dbeafe;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.38rem 0.6rem;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
  animation: livechat-new-badge-pop 0.24s ease;
}

.livechat-new-msg-badge:hover {
  border-color: rgba(59, 130, 246, 0.62);
  background: rgba(59, 130, 246, 0.3);
  color: #ffffff;
}

.livechat-thread-flash {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: min(100%, 320px);
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.16);
  color: var(--staff-text, #e5edf8);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.14);
  animation: livechat-new-badge-pop 0.24s ease;
}

.livechat-thread-flash.is-success {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.16);
  color: #d1fae5;
}

.livechat-thread-flash.is-warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

.livechat-thread-flash.is-error {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

@keyframes livechat-new-badge-pop {
  0% {
    transform: translateY(3px) scale(0.96);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.livechat-external-thread-shell {
  border: 1px solid color-mix(in srgb, var(--staff-border) 82%, transparent);
  border-radius: 12px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--staff-surface-strong) 78%, transparent),
      color-mix(in srgb, var(--staff-surface) 100%, transparent)
    );
  padding: 10px 4px 10px 10px;
}

.livechat-external-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--staff-border) 78%, transparent);
  margin-bottom: 10px;
}

.livechat-external-thread-id {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--staff-text);
}

.livechat-thread-list-flat {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 6px 12px 0;
  max-height: 390px;
  width: calc(100% + 2px);
  margin-right: -2px;
}

.livechat-thread-list-flat > :last-child {
  margin-bottom: 8px;
}

.staff-hero-actions.livechat-hero-actions {
  align-self: stretch;
  justify-content: space-between;
  gap: 12px;
  min-height: 100%;
}

.livechat-hero-actions-top {
  display: grid;
  gap: 10px;
  align-content: start;
}

.livechat-hero-actions .staff-btn-main,
.livechat-hero-actions .staff-btn-ghost {
  width: 100%;
}

.livechat-csat-card {
  min-width: 0;
  border: 1px dotted rgba(59, 130, 246, 0.54);
  border-radius: 12px;
  background: color-mix(in srgb, rgba(59, 130, 246, 0.12) 66%, var(--staff-surface-strong));
  padding: 10px 11px;
}

.livechat-csat-card-label {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--staff-text-dim);
}

.livechat-csat-card-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--staff-text);
}

.livechat-csat-card-emoji {
  font-size: 1rem;
  line-height: 1;
}

.livechat-csat-card-meta {
  font-size: 0.76rem;
  color: var(--staff-text-dim);
}

.livechat-csat-card-hero {
  width: 100%;
  margin-top: auto;
}

/* Livechat-scoped scrollbar styling (public + staff panes, textarea overflow). */
.livechat-public-thread-list,
.livechat-thread-list,
.livechat-pane-body,
.livechat-public-composer .form-control,
.livechat-intake-block .form-control,
.livechat-staff-textarea,
.livechat-ai-hooks-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--livechat-scroll-thumb) var(--livechat-scroll-track);
}

.livechat-public-thread-list::-webkit-scrollbar,
.livechat-thread-list::-webkit-scrollbar,
.livechat-pane-body::-webkit-scrollbar,
.livechat-public-composer .form-control::-webkit-scrollbar,
.livechat-intake-block .form-control::-webkit-scrollbar,
.livechat-staff-textarea::-webkit-scrollbar,
.livechat-ai-hooks-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.livechat-public-thread-list::-webkit-scrollbar-track,
.livechat-thread-list::-webkit-scrollbar-track,
.livechat-pane-body::-webkit-scrollbar-track,
.livechat-public-composer .form-control::-webkit-scrollbar-track,
.livechat-intake-block .form-control::-webkit-scrollbar-track,
.livechat-staff-textarea::-webkit-scrollbar-track,
.livechat-ai-hooks-scroll::-webkit-scrollbar-track {
  background: var(--livechat-scroll-track);
  border-radius: 999px;
}

.livechat-public-thread-list::-webkit-scrollbar-thumb,
.livechat-thread-list::-webkit-scrollbar-thumb,
.livechat-pane-body::-webkit-scrollbar-thumb,
.livechat-public-composer .form-control::-webkit-scrollbar-thumb,
.livechat-intake-block .form-control::-webkit-scrollbar-thumb,
.livechat-staff-textarea::-webkit-scrollbar-thumb,
.livechat-ai-hooks-scroll::-webkit-scrollbar-thumb {
  background: var(--livechat-scroll-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  min-height: 32px;
}

.livechat-public-thread-list:hover::-webkit-scrollbar-thumb,
.livechat-thread-list:hover::-webkit-scrollbar-thumb,
.livechat-pane-body:hover::-webkit-scrollbar-thumb,
.livechat-public-composer .form-control:hover::-webkit-scrollbar-thumb,
.livechat-intake-block .form-control:hover::-webkit-scrollbar-thumb,
.livechat-staff-textarea:hover::-webkit-scrollbar-thumb,
.livechat-ai-hooks-scroll:hover::-webkit-scrollbar-thumb {
  background: var(--livechat-scroll-thumb-hover);
}

.livechat-msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.74rem;
  color: var(--staff-text-dim);
}

.livechat-msg-group {
  border: 0;
  background: transparent;
  padding: 0;
}

.livechat-msg-group + .livechat-msg-group {
  border-top: 1px solid color-mix(in srgb, var(--staff-border) 80%, transparent);
  padding-top: 10px;
}

.livechat-msg-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.74rem;
  color: var(--staff-text-dim);
}

.livechat-msg-group-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.livechat-msg-group-agent .livechat-msg-group-body,
.livechat-msg-group-ai-assist .livechat-msg-group-body,
.livechat-msg-group-bot .livechat-msg-group-body {
  align-items: flex-end;
}

.livechat-msg-group-customer .livechat-msg-group-body,
.livechat-msg-group-system .livechat-msg-group-body {
  align-items: flex-start;
}

.livechat-msg-bubble {
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--staff-border) 84%, transparent);
  background: color-mix(in srgb, var(--staff-surface) 90%, transparent);
  padding: 9px 11px;
  width: fit-content;
  max-width: min(82%, 760px);
  min-width: 84px;
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.12);
}

.livechat-msg-bubble.is-agent {
  border-color: rgba(59, 130, 246, 0.42);
  background: rgba(37, 99, 235, 0.18);
  margin-left: auto;
  border-bottom-right-radius: 0;
}

.livechat-msg-bubble.is-customer {
  border-color: rgba(14, 165, 233, 0.48);
  background: rgba(14, 165, 233, 0.16);
  margin-right: auto;
  border-bottom-left-radius: 0;
}

.livechat-msg-bubble.is-ai-assist {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.17);
  margin-left: auto;
  border-bottom-right-radius: 0;
}

.livechat-msg-bubble.is-bot {
  border-color: rgba(56, 189, 248, 0.34);
  background: rgba(56, 189, 248, 0.13);
  margin-left: auto;
  border-bottom-right-radius: 0;
}

.livechat-msg-bubble.is-system {
  border-color: rgba(148, 163, 184, 0.26);
  background: color-mix(in srgb, var(--staff-surface-strong) 84%, transparent);
  margin-right: auto;
  border-bottom-left-radius: 0;
}

.livechat-msg-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.74rem;
  color: var(--staff-text-dim);
}

.livechat-msg-bubble-author {
  font-weight: 700;
}

.livechat-msg-bubble-time-inline {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.livechat-msg-group-ai-assist .livechat-msg-group-head strong {
  color: #f59e0b;
}

.livechat-msg-bubble.is-ai-assist .livechat-msg-bubble-author {
  color: #fbbf24;
}

.livechat-staff-textarea {
  min-height: 96px;
  max-height: 220px;
  resize: none;
  overflow-y: hidden;
  line-height: 1.45;
  transition: height 0.12s ease;
}

.livechat-staff-textarea.livechat-staff-textarea-notes {
  min-height: 84px;
  max-height: 170px;
}

.livechat-suggestion-block {
  margin-top: 12px;
  border-top: 1px dashed color-mix(in srgb, var(--staff-border) 80%, transparent);
  padding-top: 10px;
}

.livechat-suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.livechat-suggestion-form {
  margin: 0;
}

.livechat-suggestion-btn {
  width: 100%;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
}

.livechat-note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.74rem;
  color: var(--staff-text-dim);
}

.livechat-note-actions {
  align-items: center;
}

.livechat-note-actions .btn {
  border-radius: 999px;
  font-weight: 700;
}

.livechat-note-feedback-stack .alert {
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.livechat-ownership-state {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--staff-border) 86%, transparent);
  background: color-mix(in srgb, var(--staff-surface-strong) 72%, transparent);
  padding: 10px 11px;
}

.livechat-ownership-state strong {
  display: inline-block;
  margin-bottom: 4px;
}

.livechat-ownership-state.state-assigned_to_me {
  border-color: rgba(34, 197, 94, 0.34);
  background: rgba(34, 197, 94, 0.12);
}

.livechat-ownership-state.state-assigned_to_other {
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.13);
}

.livechat-readonly-help {
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--staff-border) 78%, transparent);
  background: color-mix(in srgb, var(--staff-surface-strong) 70%, transparent);
  color: var(--staff-text-dim);
  font-size: 0.83rem;
  padding: 8px 10px;
}

.livechat-note-list,
.livechat-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.livechat-note-item,
.livechat-history-item {
  border: 1px solid color-mix(in srgb, var(--staff-border) 84%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--staff-surface-strong) 70%, transparent);
  padding: 10px 11px;
}

@media (max-width: 1199.98px) {
  .livechat-workspace {
    grid-template-columns: minmax(240px, 0.9fr) minmax(360px, 1.3fr);
  }

  .livechat-pane-context {
    grid-column: 1 / -1;
    min-height: 320px;
  }

  .staff-hero-actions.livechat-hero-actions {
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
  }
}

@media (max-width: 991.98px) {
  .livechat-workspace {
    grid-template-columns: 1fr;
  }

  .livechat-pane-shell {
    min-height: 360px;
  }

  .livechat-priority-grid {
    grid-template-columns: 1fr;
  }

  .livechat-context-grid {
    grid-template-columns: 1fr;
  }

  .livechat-shift-toggle-btn {
    min-width: 0;
    width: 100%;
  }

  .livechat-shift-toggle-title {
    font-size: 0.9rem;
  }

  .livechat-ai-shift-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .staff-hero-actions.livechat-hero-actions {
    justify-content: flex-start;
    gap: 10px;
  }

  .livechat-hero-actions-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .livechat-csat-card-hero {
    margin-top: 0;
    width: 100%;
  }

  .livechat-inbox-item {
    flex-direction: column;
  }

  .livechat-inbox-side {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
  }

  .livechat-standard-badge {
    width: 100%;
    justify-content: center;
  }

  .livechat-inbox-toolbar-form,
  .livechat-inbox-toolbar-actions,
  .livechat-inbox-toolbar-group {
    width: 100%;
  }

  .livechat-inbox-toolbar-actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 575.98px) {
  .livechat-fab {
    right: 0.8rem;
    bottom: 0.8rem;
    width: 52px;
    height: 52px;
  }

  .livechat-public-panel {
    width: 100vw;
  }

  .livechat-public-panel .btn-close {
    display: inline-flex !important;
    opacity: 0.9;
  }

  .livechat-public-panel.offcanvas-end {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
  }

  .livechat-public-thread-shell {
    min-height: 180px;
  }

  .livechat-public-thread-list {
    max-height: 42vh;
  }

  .livechat-public-msg {
    max-width: 92%;
    font-size: 0.9rem;
  }

  .livechat-public-csat-scale {
    gap: 5px;
  }

  .livechat-csat-pill {
    min-height: 32px;
  }

  .livechat-public-alert-slot {
    flex-wrap: wrap;
  }

  .livechat-public-chat-stack {
    padding-top: 6px;
  }

  .livechat-public-alert-slot-top {
    top: 12px;
    width: calc(100% - 1.1rem);
    max-width: calc(100% - 1.1rem);
  }

  .livechat-public-alert-slot-top .livechat-inline-toast {
    max-width: 96%;
  }

  .livechat-inline-toast-state {
    max-width: 100%;
  }

  .livechat-public-mini-close-btn {
    width: 54%;
    min-width: 146px;
  }

  .livechat-public-close-btn {
    display: none !important;
  }

  .livechat-public-close-note {
    display: block;
  }

  .livechat-public-composer .form-control {
    min-height: 72px;
  }

  .livechat-public-composer-hint {
    font-size: 0.68rem;
  }

  .livechat-topic-chip {
    font-size: 0.78rem;
  }

  .livechat-public-thread-toggle {
    font-size: 0.69rem;
    padding: 0.2rem 0.44rem;
  }

  .livechat-public-thread-list::-webkit-scrollbar,
  .livechat-thread-list::-webkit-scrollbar,
  .livechat-pane-body::-webkit-scrollbar,
  .livechat-public-composer .form-control::-webkit-scrollbar,
  .livechat-intake-block .form-control::-webkit-scrollbar,
  .livechat-staff-textarea::-webkit-scrollbar,
  .livechat-ai-hooks-scroll::-webkit-scrollbar {
    width: 5px;
    height: 5px;
  }

  .livechat-public-thread-list::-webkit-scrollbar-thumb,
  .livechat-thread-list::-webkit-scrollbar-thumb,
  .livechat-pane-body::-webkit-scrollbar-thumb,
  .livechat-public-composer .form-control::-webkit-scrollbar-thumb,
  .livechat-intake-block .form-control::-webkit-scrollbar-thumb,
  .livechat-staff-textarea::-webkit-scrollbar-thumb,
  .livechat-ai-hooks-scroll::-webkit-scrollbar-thumb {
    border-width: 1px;
    min-height: 24px;
  }
}
