/* ==========================================================================
   Smart Floating Contact PRO v1.0.21 — Frontend stylesheet
   Every selector starts with .sfc-pro- (namespace isolation, no theme
   classes are touched). Logical properties only — no physical left/right
   for layout; direction comes from [dir] / logical props, never hardcoded.
   Safe areas via env(safe-area-inset-*). Animations honour
   prefers-reduced-motion. Only `display` uses !important (hiding).
   ========================================================================== */

/* ---------- Widget root: fixed, namespaced, theme-independent ---------- */
.sfc-pro-widget {
  position: fixed;
  z-index: var(--sfc-z, 9999);
  font-family: inherit;
  font-size: var(--sfc-font-size, 14px);
  line-height: 1.5;
  color: #1a1a1a;
  direction: inherit;
  opacity: var(--sfc-opacity, 1);
  -webkit-tap-highlight-color: transparent;
}
.sfc-pro-widget *,
.sfc-pro-widget *::before,
.sfc-pro-widget *::after { box-sizing: border-box; }
.sfc-pro-widget img { max-width: 100%; height: auto; }
.sfc-pro-widget button { font-family: inherit; cursor: pointer; }
.sfc-pro-widget a { text-decoration: none; }

/* ---------- Vertical placement ---------- */
.sfc-pro-widget.sfc-pro-v-top { top: var(--sfc-offset-top, 20px); top: calc(var(--sfc-offset-top, 20px) + env(safe-area-inset-top, 0px)); }
.sfc-pro-widget.sfc-pro-v-middle { top: 50%; transform: translateY(-50%); }
.sfc-pro-widget.sfc-pro-v-bottom { bottom: var(--sfc-offset-bottom, 20px); bottom: calc(var(--sfc-offset-bottom, 20px) + env(safe-area-inset-bottom, 0px)); }

/* ---------- Horizontal placement (logical + physical) ---------- */
/* Literal sides are physical: "bottom-left" stays bottom-left in RTL too.
   Only the start/end side modes use logical properties (below). v1.0.6
   mixed logical + physical here and flipped the button in RTL. */
.sfc-pro-widget.sfc-pro-h-right { right: var(--sfc-offset-x, 20px); }
.sfc-pro-widget.sfc-pro-h-left { left: var(--sfc-offset-x, 20px); }
.sfc-pro-widget.sfc-pro-h-start { inset-inline-start: var(--sfc-offset-x, 20px); }
.sfc-pro-widget.sfc-pro-h-end { inset-inline-end: var(--sfc-offset-x, 20px); }
.sfc-pro-widget.sfc-pro-h-custom {
  /* Same anchor as the admin Live Preview: custom sits on the left. */
  left: var(--sfc-offset-x, 20px);
  bottom: var(--sfc-offset-y, 20px);
  bottom: calc(var(--sfc-offset-y, 20px) + env(safe-area-inset-bottom, 0px));
}
.sfc-pro-widget.sfc-pro-pos-custom.sfc-pro-v-top { top: var(--sfc-offset-top, 20px); bottom: auto; }
.sfc-pro-widget.sfc-pro-pos-custom.sfc-pro-v-middle { top: 50%; bottom: auto; }

/* Safe-area aware side offsets (physical, same on both directions) */
.sfc-pro-widget.sfc-pro-h-right { right: calc(var(--sfc-offset-x, 20px) + env(safe-area-inset-right, 0px)); }
.sfc-pro-widget.sfc-pro-h-left { left: calc(var(--sfc-offset-x, 20px) + env(safe-area-inset-left, 0px)); }

/* Popup & panel must open toward the page, never off-screen: they anchor
   to the same physical side as the button. The old base rule used
   inset-inline-end, which flips in RTL and pushed the popup off the
   viewport on right-side buttons (half of it invisible). */
.sfc-pro-widget.sfc-pro-h-right .sfc-pro-panel,
.sfc-pro-widget.sfc-pro-h-right .sfc-pro-popup { inset-inline-end: auto; right: 0; }
.sfc-pro-widget.sfc-pro-h-left .sfc-pro-panel,
.sfc-pro-widget.sfc-pro-h-left .sfc-pro-popup,
.sfc-pro-widget.sfc-pro-h-custom .sfc-pro-panel,
.sfc-pro-widget.sfc-pro-h-custom .sfc-pro-popup { inset-inline-end: auto; left: 0; }
.sfc-pro-widget.sfc-pro-h-start .sfc-pro-panel,
.sfc-pro-widget.sfc-pro-h-start .sfc-pro-popup { inset-inline-end: auto; inset-inline-start: 0; }
/* h-end keeps the base inset-inline-end: 0 — correct on both directions. */

/* Dragged position (JS sets inline inset values, classes stay for styling) */
.sfc-pro-widget.sfc-pro-dragged { transform: none; }

/* ---------- Floating button ---------- */
.sfc-pro-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: var(--sfc-btn-size, 60px);
  height: var(--sfc-btn-size, 60px);
  padding: 0;
  border: 1px solid var(--sfc-border-color, transparent);
  border-radius: var(--sfc-radius, 50px);
  background: var(--sfc-bg, #25d366);
  color: var(--sfc-icon-color, #fff);
  box-shadow: 0 6px 20px var(--sfc-shadow-color, rgba(0, 0, 0, .25));
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
  outline: none;
}
.sfc-pro-widget.sfc-pro-shape-circle .sfc-pro-button { border-radius: 50%; }
.sfc-pro-widget.sfc-pro-shape-rounded .sfc-pro-button { border-radius: var(--sfc-radius, 16px); }
.sfc-pro-widget.sfc-pro-shape-rect .sfc-pro-button { border-radius: 4px; }
.sfc-pro-button:hover,
.sfc-pro-button:focus-visible { background: var(--sfc-hover, #1ebe5b); transform: scale(1.06); }
.sfc-pro-button:focus-visible { box-shadow: 0 0 0 3px rgba(37, 211, 102, .45), 0 6px 20px var(--sfc-shadow-color, rgba(0, 0, 0, .25)); }
.sfc-pro-button:active { transform: scale(.97); }
.sfc-pro-widget.sfc-pro-gradient-on .sfc-pro-button,
.sfc-pro-widget[style*="--sfc-gradient:1"] .sfc-pro-button { background: linear-gradient(135deg, var(--sfc-bg-from, #25d366), var(--sfc-bg-to, #128c7e)); }
.sfc-pro-button-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: var(--sfc-icon-size, 30px); height: var(--sfc-icon-size, 30px); }
.sfc-pro-button-icon svg { width: 100%; height: 100%; display: block; }
.sfc-pro-button-label {
  color: var(--sfc-text-color, #fff);
  font-size: var(--sfc-font-size, 14px);
  font-weight: 600;
  white-space: nowrap;
  padding-inline-end: 14px;
}
.sfc-pro-button:has(.sfc-pro-button-label) { width: auto; padding-inline-start: 14px; }

/* ---------- Badge / online dot / tooltip ---------- */
.sfc-pro-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  min-width: 20px;
  height: 20px;
  padding-inline: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e0245e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: 2px solid #fff;
}
.sfc-pro-online-dot {
  position: absolute;
  bottom: 2px;
  inset-inline-end: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
}
.sfc-pro-widget.sfc-pro-offline .sfc-pro-online-dot { background: #9ca3af; }
.sfc-pro-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  inset-inline-end: 0;
  max-width: 220px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  white-space: normal;
  text-align: start;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  pointer-events: none;
  z-index: 1;
}
.sfc-pro-button:hover .sfc-pro-tooltip,
.sfc-pro-button:focus-visible .sfc-pro-tooltip { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- Button animations ---------- */
@keyframes sfc-pro-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .45), 0 6px 20px var(--sfc-shadow-color, rgba(0, 0, 0, .25)); }
  70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0), 0 6px 20px var(--sfc-shadow-color, rgba(0, 0, 0, .25)); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0), 0 6px 20px var(--sfc-shadow-color, rgba(0, 0, 0, .25)); }
}
@keyframes sfc-pro-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes sfc-pro-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes sfc-pro-ring {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); }
  100% { box-shadow: 0 0 0 18px rgba(37, 211, 102, 0); }
}
@keyframes sfc-pro-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes sfc-pro-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sfc-pro-slide-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.sfc-pro-widget.sfc-pro-anim-pulse .sfc-pro-button { animation: sfc-pro-pulse var(--sfc-anim-speed, 2s) ease-out var(--sfc-anim-delay, 0s) infinite; }
.sfc-pro-widget.sfc-pro-anim-bounce .sfc-pro-button { animation: sfc-pro-bounce var(--sfc-anim-speed, 2s) ease-in-out var(--sfc-anim-delay, 0s) infinite; }
.sfc-pro-widget.sfc-pro-anim-shake .sfc-pro-button { animation: sfc-pro-shake var(--sfc-anim-speed, 2s) ease-in-out var(--sfc-anim-delay, 0s) infinite; }
.sfc-pro-widget.sfc-pro-anim-ring .sfc-pro-button { animation: sfc-pro-ring var(--sfc-anim-speed, 2s) ease-out var(--sfc-anim-delay, 0s) infinite; }
.sfc-pro-widget.sfc-pro-anim-float .sfc-pro-button { animation: sfc-pro-float var(--sfc-anim-speed, 2s) ease-in-out var(--sfc-anim-delay, 0s) infinite; }
.sfc-pro-widget.sfc-pro-anim-fade .sfc-pro-button { animation: sfc-pro-fade-in .6s ease var(--sfc-anim-delay, 0s) both; }
.sfc-pro-widget.sfc-pro-anim-slide .sfc-pro-button { animation: sfc-pro-slide-in .45s ease var(--sfc-anim-delay, 0s) both; }
.sfc-pro-widget.sfc-pro-anim-hover-scale .sfc-pro-button:hover { transform: scale(1.12); }

/* ---------- Panel (channels + agents) ---------- */
.sfc-pro-panel {
  position: absolute;
  bottom: calc(var(--sfc-btn-size, 60px) + 12px);
  inset-inline-end: 0;
  width: min(320px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
  color: #1a1a1a;
  text-align: start;
}
.sfc-pro-widget.sfc-pro-v-top .sfc-pro-panel { bottom: auto; top: calc(var(--sfc-btn-size, 60px) + 12px); }
.sfc-pro-widget.sfc-pro-v-middle .sfc-pro-panel { bottom: auto; top: 50%; transform: translateY(-50%); }
.sfc-pro-widget.sfc-pro-panel-down .sfc-pro-panel { bottom: auto; top: calc(var(--sfc-btn-size, 60px) + 12px); }
.sfc-pro-widget.sfc-pro-panel-up .sfc-pro-panel { bottom: calc(var(--sfc-btn-size, 60px) + 12px); top: auto; }
/* Panel directions are literal too: "left" opens to the physical left. */
.sfc-pro-widget.sfc-pro-panel-left .sfc-pro-panel { right: calc(var(--sfc-btn-size, 60px) + 12px); inset-inline-end: auto; bottom: 0; top: auto; }
.sfc-pro-widget.sfc-pro-panel-right .sfc-pro-panel { left: calc(var(--sfc-btn-size, 60px) + 12px); inset-inline-end: auto; bottom: 0; top: auto; }
.sfc-pro-panel[hidden] { display: none !important; }
.sfc-pro-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef0f2;
}
.sfc-pro-panel-title { font-size: 15px; font-weight: 700; color: #111827; }
.sfc-pro-panel-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #4b5563;
}
.sfc-pro-panel-close:hover { background: #e5e7eb; color: #111827; }
.sfc-pro-panel-close svg { width: 16px; height: 16px; }

/* Channels */
.sfc-pro-channels { display: flex; flex-direction: column; padding: 8px; }
.sfc-pro-channel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #111827;
  transition: background-color .15s ease;
}
.sfc-pro-channel:hover, .sfc-pro-channel:focus-visible { background: #f3f4f6; outline: none; }
.sfc-pro-channel-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sfc-channel-bg, #25d366);
  color: var(--sfc-channel-color, #fff);
  overflow: hidden;
}
.sfc-pro-channel-icon svg { width: 22px; height: 22px; display: block; }
.sfc-pro-channel-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sfc-pro-channel-icon .fa { font-size: 20px; }
.sfc-pro-channel-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sfc-pro-channel-title { font-size: 14px; font-weight: 600; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sfc-pro-channel-desc { font-size: 12px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sfc-pro-channel-arrow { flex: 0 0 auto; color: #9ca3af; display: inline-flex; }
.sfc-pro-channel-arrow svg { width: 18px; height: 18px; }
[dir="rtl"] .sfc-pro-channel-arrow svg { transform: scaleX(-1); }

/* Agents */
.sfc-pro-agents { padding: 8px 8px 12px; border-top: 1px solid #eef0f2; }
.sfc-pro-agents-title { padding: 8px 12px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.sfc-pro-agent { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; }
.sfc-pro-agent:hover { background: #f9fafb; }
/* The whole agent row is the chat link (v1.0.12): it fills the row, the
   copy-number button stays a sibling outside it. Keyboard focus on the
   link highlights the row exactly like hover does. */
.sfc-pro-agent-link { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; color: inherit; text-decoration: none; }
.sfc-pro-agent-link:focus-visible { outline: none; }
.sfc-pro-agent:focus-within { background: #f9fafb; }
.sfc-pro-agent-avatar { position: relative; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; background: #dcfce7; color: #128c7e; overflow: visible; display: inline-flex; align-items: center; justify-content: center; }
.sfc-pro-agent-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.sfc-pro-agent-avatar svg { width: 24px; height: 24px; }
.sfc-pro-agent-status-dot { position: absolute; bottom: 0; inset-inline-end: 0; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.sfc-pro-agent-offline .sfc-pro-agent-status-dot { background: #9ca3af; }
.sfc-pro-agent-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sfc-pro-agent-name { font-size: 14px; font-weight: 600; color: #111827; }
.sfc-pro-agent-title, .sfc-pro-agent-desc { font-size: 12px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sfc-pro-agent-status { font-size: 12px; font-weight: 600; color: #16a34a; }
.sfc-pro-agent-offline .sfc-pro-agent-status { color: #6b7280; }
.sfc-pro-agent-action {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
}
.sfc-pro-agent-action:hover { background: #1ebe5b; }
.sfc-pro-agent-action svg { width: 20px; height: 20px; }

/* Copy number */
.sfc-pro-copy-number {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font-size: 13px;
}
.sfc-pro-copy-number:hover { background: #f3f4f6; }
.sfc-pro-copy-number svg { width: 16px; height: 16px; }
.sfc-pro-copy-number-text { white-space: nowrap; }
.sfc-pro-copy-number-wide { width: 100%; border-radius: 10px; padding: 10px 12px; }
.sfc-pro-panel-footer { padding: 0 12px 12px; }

/* ---------- Greeting popup ---------- */
.sfc-pro-popup {
  position: absolute;
  bottom: calc(var(--sfc-btn-size, 60px) + 12px);
  inset-inline-end: 0;
  width: var(--sfc-popup-width, 320px);
  width: min(var(--sfc-popup-width, 320px), calc(100vw - 32px));
  background: var(--sfc-popup-bg, #fff);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
  overflow: hidden;
  text-align: start;
  animation: sfc-pro-slide-in .3s ease both;
}
.sfc-pro-widget.sfc-pro-v-top .sfc-pro-popup { bottom: auto; top: calc(var(--sfc-btn-size, 60px) + 12px); }
.sfc-pro-widget.sfc-pro-v-middle .sfc-pro-popup { bottom: auto; top: 50%; transform: translateY(-50%); animation-name: sfc-pro-fade-in; }
.sfc-pro-popup[hidden] { display: none !important; }
.sfc-pro-popup-inner { display: flex; flex-direction: column; }
.sfc-pro-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #075e54;
  color: #fff;
}
.sfc-pro-popup-agent { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sfc-pro-popup-avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  overflow: hidden;
}
.sfc-pro-popup-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sfc-pro-popup-avatar svg { width: 24px; height: 24px; }
.sfc-pro-popup-agent-info { display: flex; flex-direction: column; min-width: 0; }
.sfc-pro-popup-agent-name { font-size: 15px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sfc-pro-popup-agent-title { font-size: 12px; color: rgba(255, 255, 255, .85); }
.sfc-pro-popup-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255, 255, 255, .9); }
.sfc-pro-popup-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.sfc-pro-widget.sfc-pro-offline .sfc-pro-popup-status-dot { background: #d1d5db; }
.sfc-pro-popup-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
}
.sfc-pro-popup-close:hover { background: rgba(255, 255, 255, .18); }
.sfc-pro-popup-close svg { width: 16px; height: 16px; }
.sfc-pro-popup-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.sfc-pro-popup-title { font-size: 17px; font-weight: 700; color: var(--sfc-popup-title-color, #111); }
.sfc-pro-popup-text { margin: 0; font-size: 14px; color: var(--sfc-popup-text-color, #555); white-space: pre-line; }
.sfc-pro-popup-desc { margin: 0; font-size: 13px; color: var(--sfc-popup-text-color, #555); opacity: .85; white-space: pre-line; }
.sfc-pro-popup-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.sfc-pro-popup-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--sfc-popup-button-color, #25d366);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.sfc-pro-popup-cta:hover { filter: brightness(.94); color: #fff; }
.sfc-pro-popup-cta svg { width: 20px; height: 20px; flex: 0 0 auto; }
.sfc-pro-popup-action {
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}
.sfc-pro-popup-action:hover { background: #f3f4f6; }
.sfc-pro-popup-note { font-size: 12px; color: #6b7280; text-align: center; }

/* Dark popup theme */
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-popup { background: #1f2937; border-color: #374151; color: #f3f4f6; }
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-popup-title { color: #f9fafb; }
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-popup-text,
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-popup-desc { color: #d1d5db; }
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-popup-action { background: #374151; border-color: #4b5563; color: #f3f4f6; }
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-popup-action:hover { background: #4b5563; }
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-popup-note { color: #9ca3af; }
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-panel { background: #1f2937; border-color: #374151; color: #f3f4f6; }
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-panel-title,
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-channel-title,
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-agent-name { color: #f9fafb; }
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-channel:hover,
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-agent:hover { background: #374151; }
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-agent:focus-within { background: #374151; }
.sfc-pro-widget.sfc-pro-theme-dark .sfc-pro-panel-close { background: #374151; color: #d1d5db; }

/* Panel direction "auto": same as up (panel opens above the button). */
.sfc-pro-widget.sfc-pro-panel-auto .sfc-pro-panel { bottom: calc(var(--sfc-btn-size, 60px) + 12px); top: auto; }
/* Light theme is the default; rule exists so the class is styled, not dangling. */
.sfc-pro-widget.sfc-pro-theme-light .sfc-pro-popup { background: var(--sfc-popup-bg, #fff); }
/* Draggable state: grab cursor; dragging itself uses .sfc-pro-dragging. */
.sfc-pro-widget.sfc-pro-draggable .sfc-pro-button { cursor: grab; touch-action: none; }
/* Online state (offline overrides the dot colour below it). */
.sfc-pro-widget.sfc-pro-online .sfc-pro-online-dot { background: #22c55e; }
/* Agent online state: explicit (base colour is already green). */
.sfc-pro-agent-online .sfc-pro-agent-status { color: #16a34a; }
/* Animation "none": explicitly no animation. */
.sfc-pro-widget.sfc-pro-anim-none .sfc-pro-button { animation: none; }
/* Custom popup theme: colours come from the --sfc-popup-* variables. */
.sfc-pro-widget.sfc-pro-theme-custom .sfc-pro-popup { background: var(--sfc-popup-bg, #fff); }
.sfc-pro-widget.sfc-pro-open .sfc-pro-button { transform: scale(1.04); }
.sfc-pro-widget.sfc-pro-visible { opacity: var(--sfc-opacity, 1); }

/* ---------- Responsive: tablet ---------- */
@media (max-width: 1024px) {
  .sfc-pro-widget .sfc-pro-button { width: var(--sfc-btn-size-tablet, 56px); height: var(--sfc-btn-size-tablet, 56px); }
  .sfc-pro-widget.sfc-pro-hide-tablet { display: none !important; }
  .sfc-pro-panel, .sfc-pro-popup { bottom: calc(var(--sfc-btn-size-tablet, 56px) + 12px); }
  .sfc-pro-widget.sfc-pro-v-top .sfc-pro-panel,
  .sfc-pro-widget.sfc-pro-v-top .sfc-pro-popup { top: calc(var(--sfc-btn-size-tablet, 56px) + 12px); bottom: auto; }

  /* Per-device positions (v1.0.7): the sfc-pro-v-tablet-*/sfc-pro-h-tablet-*
     classes override the base (desktop) placement. Every rule resets the
     opposite side, because the base may have set any of them. */
  .sfc-pro-widget.sfc-pro-v-tablet-top { top: var(--sfc-offset-top, 20px); top: calc(var(--sfc-offset-top, 20px) + env(safe-area-inset-top, 0px)); bottom: auto; transform: none; }
  .sfc-pro-widget.sfc-pro-v-tablet-middle { top: 50%; bottom: auto; transform: translateY(-50%); }
  .sfc-pro-widget.sfc-pro-v-tablet-bottom { bottom: var(--sfc-offset-bottom, 20px); bottom: calc(var(--sfc-offset-bottom, 20px) + env(safe-area-inset-bottom, 0px)); top: auto; transform: none; }
  .sfc-pro-widget.sfc-pro-h-tablet-right { right: calc(var(--sfc-offset-x, 20px) + env(safe-area-inset-right, 0px)); left: auto; inset-inline-start: auto; inset-inline-end: auto; }
  .sfc-pro-widget.sfc-pro-h-tablet-left { left: calc(var(--sfc-offset-x, 20px) + env(safe-area-inset-left, 0px)); right: auto; inset-inline-start: auto; inset-inline-end: auto; }
  .sfc-pro-widget.sfc-pro-h-tablet-start { inset-inline-start: var(--sfc-offset-x, 20px); right: auto; left: auto; inset-inline-end: auto; }
  .sfc-pro-widget.sfc-pro-h-tablet-end { inset-inline-end: var(--sfc-offset-x, 20px); right: auto; left: auto; inset-inline-start: auto; }
  .sfc-pro-widget.sfc-pro-h-tablet-custom { left: calc(var(--sfc-offset-x, 20px) + env(safe-area-inset-left, 0px)); bottom: calc(var(--sfc-offset-y, 20px) + env(safe-area-inset-bottom, 0px)); right: auto; inset-inline-start: auto; inset-inline-end: auto; }
  /* Panel/popup anchor follows the tablet side. */
  .sfc-pro-widget.sfc-pro-h-tablet-right .sfc-pro-panel,
  .sfc-pro-widget.sfc-pro-h-tablet-right .sfc-pro-popup { inset-inline-end: auto; right: 0; left: auto; inset-inline-start: auto; }
  .sfc-pro-widget.sfc-pro-h-tablet-left .sfc-pro-panel,
  .sfc-pro-widget.sfc-pro-h-tablet-left .sfc-pro-popup,
  .sfc-pro-widget.sfc-pro-h-tablet-custom .sfc-pro-panel,
  .sfc-pro-widget.sfc-pro-h-tablet-custom .sfc-pro-popup { inset-inline-end: auto; left: 0; right: auto; inset-inline-start: auto; }
  .sfc-pro-widget.sfc-pro-h-tablet-start .sfc-pro-panel,
  .sfc-pro-widget.sfc-pro-h-tablet-start .sfc-pro-popup { inset-inline-end: auto; inset-inline-start: 0; right: auto; left: auto; }
  .sfc-pro-widget.sfc-pro-h-tablet-end .sfc-pro-panel,
  .sfc-pro-widget.sfc-pro-h-tablet-end .sfc-pro-popup { inset-inline-start: auto; inset-inline-end: 0; right: auto; left: auto; }
  /* Panel/popup vertical follows the tablet placement. Panel rules are
     scoped to the auto direction so an explicit panel_direction still wins. */
  .sfc-pro-widget.sfc-pro-panel-auto.sfc-pro-v-tablet-top .sfc-pro-panel { bottom: auto; top: calc(var(--sfc-btn-size-tablet, 56px) + 12px); transform: none; }
  .sfc-pro-widget.sfc-pro-v-tablet-top .sfc-pro-popup { bottom: auto; top: calc(var(--sfc-btn-size-tablet, 56px) + 12px); }
  .sfc-pro-widget.sfc-pro-panel-auto.sfc-pro-v-tablet-middle .sfc-pro-panel { bottom: auto; top: 50%; transform: translateY(-50%); }
  .sfc-pro-widget.sfc-pro-v-tablet-middle .sfc-pro-popup { bottom: auto; top: 50%; transform: translateY(-50%); animation-name: sfc-pro-fade-in; }
  .sfc-pro-widget.sfc-pro-panel-auto.sfc-pro-v-tablet-bottom .sfc-pro-panel { top: auto; bottom: calc(var(--sfc-btn-size-tablet, 56px) + 12px); transform: none; }
  .sfc-pro-widget.sfc-pro-v-tablet-bottom .sfc-pro-popup { top: auto; bottom: calc(var(--sfc-btn-size-tablet, 56px) + 12px); }
}

/* ---------- Responsive: mobile ---------- */
@media (max-width: 767px) {
  .sfc-pro-widget .sfc-pro-button { width: var(--sfc-btn-size-mobile, 56px); height: var(--sfc-btn-size-mobile, 56px); }
  .sfc-pro-widget.sfc-pro-hide-mobile { display: none !important; }
  .sfc-pro-panel, .sfc-pro-popup { bottom: calc(var(--sfc-btn-size-mobile, 56px) + 12px); }
  .sfc-pro-widget.sfc-pro-v-top .sfc-pro-panel,
  .sfc-pro-widget.sfc-pro-v-top .sfc-pro-popup { top: calc(var(--sfc-btn-size-mobile, 56px) + 12px); bottom: auto; }

  /* Per-device positions (v1.0.7): same overrides as tablet, for mobile.
     These come before the full-width popup rules below, so those keep
     winning ties for the popup on mobile. */
  .sfc-pro-widget.sfc-pro-v-mobile-top { top: var(--sfc-offset-top, 20px); top: calc(var(--sfc-offset-top, 20px) + env(safe-area-inset-top, 0px)); bottom: auto; transform: none; }
  .sfc-pro-widget.sfc-pro-v-mobile-middle { top: 50%; bottom: auto; transform: translateY(-50%); }
  .sfc-pro-widget.sfc-pro-v-mobile-bottom { bottom: var(--sfc-offset-bottom, 20px); bottom: calc(var(--sfc-offset-bottom, 20px) + env(safe-area-inset-bottom, 0px)); top: auto; transform: none; }
  .sfc-pro-widget.sfc-pro-h-mobile-right { right: calc(var(--sfc-offset-x, 20px) + env(safe-area-inset-right, 0px)); left: auto; inset-inline-start: auto; inset-inline-end: auto; }
  .sfc-pro-widget.sfc-pro-h-mobile-left { left: calc(var(--sfc-offset-x, 20px) + env(safe-area-inset-left, 0px)); right: auto; inset-inline-start: auto; inset-inline-end: auto; }
  .sfc-pro-widget.sfc-pro-h-mobile-start { inset-inline-start: var(--sfc-offset-x, 20px); right: auto; left: auto; inset-inline-end: auto; }
  .sfc-pro-widget.sfc-pro-h-mobile-end { inset-inline-end: var(--sfc-offset-x, 20px); right: auto; left: auto; inset-inline-start: auto; }
  .sfc-pro-widget.sfc-pro-h-mobile-custom { left: calc(var(--sfc-offset-x, 20px) + env(safe-area-inset-left, 0px)); bottom: calc(var(--sfc-offset-y, 20px) + env(safe-area-inset-bottom, 0px)); right: auto; inset-inline-start: auto; inset-inline-end: auto; }
  .sfc-pro-widget.sfc-pro-h-mobile-right .sfc-pro-panel,
  .sfc-pro-widget.sfc-pro-h-mobile-right .sfc-pro-popup { inset-inline-end: auto; right: 0; left: auto; inset-inline-start: auto; }
  .sfc-pro-widget.sfc-pro-h-mobile-left .sfc-pro-panel,
  .sfc-pro-widget.sfc-pro-h-mobile-left .sfc-pro-popup,
  .sfc-pro-widget.sfc-pro-h-mobile-custom .sfc-pro-panel,
  .sfc-pro-widget.sfc-pro-h-mobile-custom .sfc-pro-popup { inset-inline-end: auto; left: 0; right: auto; inset-inline-start: auto; }
  .sfc-pro-widget.sfc-pro-h-mobile-start .sfc-pro-panel,
  .sfc-pro-widget.sfc-pro-h-mobile-start .sfc-pro-popup { inset-inline-end: auto; inset-inline-start: 0; right: auto; left: auto; }
  .sfc-pro-widget.sfc-pro-h-mobile-end .sfc-pro-panel,
  .sfc-pro-widget.sfc-pro-h-mobile-end .sfc-pro-popup { inset-inline-start: auto; inset-inline-end: 0; right: auto; left: auto; }
  .sfc-pro-widget.sfc-pro-panel-auto.sfc-pro-v-mobile-top .sfc-pro-panel { bottom: auto; top: calc(var(--sfc-btn-size-mobile, 56px) + 12px); transform: none; }
  .sfc-pro-widget.sfc-pro-v-mobile-top .sfc-pro-popup { bottom: auto; top: calc(var(--sfc-btn-size-mobile, 56px) + 12px); }
  .sfc-pro-widget.sfc-pro-panel-auto.sfc-pro-v-mobile-middle .sfc-pro-panel { bottom: auto; top: 50%; transform: translateY(-50%); }
  .sfc-pro-widget.sfc-pro-v-mobile-middle .sfc-pro-popup { bottom: auto; top: 50%; transform: translateY(-50%); animation-name: sfc-pro-fade-in; }
  .sfc-pro-widget.sfc-pro-panel-auto.sfc-pro-v-mobile-bottom .sfc-pro-panel { top: auto; bottom: calc(var(--sfc-btn-size-mobile, 56px) + 12px); transform: none; }
  .sfc-pro-widget.sfc-pro-v-mobile-bottom .sfc-pro-popup { top: auto; bottom: calc(var(--sfc-btn-size-mobile, 56px) + 12px); }
  .sfc-pro-button-label { display: none; }
  .sfc-pro-button:has(.sfc-pro-button-label) { width: var(--sfc-btn-size-mobile, 56px); padding-inline-start: 0; }
  /* Full-width popup on mobile when enabled */
  .sfc-pro-widget.sfc-pro-popup-full-mobile .sfc-pro-popup {
    position: fixed;
    inset-inline: 16px;
    inset-inline-end: 16px;
    bottom: calc(var(--sfc-btn-size-mobile, 56px) + 20px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
  }
  .sfc-pro-widget.sfc-pro-popup-full-mobile.sfc-pro-v-top .sfc-pro-popup {
    top: calc(var(--sfc-btn-size-mobile, 56px) + 20px + env(safe-area-inset-top, 0px));
    bottom: auto;
  }
  .sfc-pro-tooltip { display: none; }
}

/* ---------- Desktop-only hiding ---------- */
@media (min-width: 1025px) {
  .sfc-pro-widget.sfc-pro-hide-desktop { display: none !important; }
}

/* ---------- Dragging ---------- */
.sfc-pro-widget.sfc-pro-dragging .sfc-pro-button { cursor: grabbing; transition: none; }
.sfc-pro-widget.sfc-pro-dragging { user-select: none; }

/* ---------- Reduced motion: stop ALL animation ---------- */
@media (prefers-reduced-motion: reduce) {
  .sfc-pro-widget .sfc-pro-button,
  .sfc-pro-widget.sfc-pro-anim-pulse .sfc-pro-button,
  .sfc-pro-widget.sfc-pro-anim-bounce .sfc-pro-button,
  .sfc-pro-widget.sfc-pro-anim-shake .sfc-pro-button,
  .sfc-pro-widget.sfc-pro-anim-ring .sfc-pro-button,
  .sfc-pro-widget.sfc-pro-anim-float .sfc-pro-button,
  .sfc-pro-widget.sfc-pro-anim-fade .sfc-pro-button,
  .sfc-pro-widget.sfc-pro-anim-slide .sfc-pro-button,
  .sfc-pro-widget .sfc-pro-popup,
  .sfc-pro-widget .sfc-pro-tooltip {
    animation: none;
    transition: none;
  }
}
.sfc-pro-widget.sfc-pro-reduced-motion .sfc-pro-button,
.sfc-pro-widget.sfc-pro-reduced-motion .sfc-pro-popup { animation: none; transition: none; }
