/* Scheffer Media WhatsApp Chat */
.smwac {
  --smwac-color: #1f9d55;
  --smwac-dark: color-mix(in srgb, var(--smwac-color) 62%, #000);
  --smwac-text: #1f2a30;
  --smwac-muted: #3d4f5c;
  position: fixed;
  bottom: 20px;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  gap: 10px;
  --smwac-z: var(--smwac-scale, 1);
  max-width: calc((100vw - 32px) / var(--smwac-z));
  zoom: var(--smwac-z);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  color: var(--smwac-text);
}
.smwac *, .smwac *::before, .smwac *::after { box-sizing: border-box; }
.smwac--right { right: 16px; align-items: flex-end; }
.smwac--left { left: 16px; align-items: flex-start; }

.smwac__bubble {
  width: 60px;
  height: 60px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--smwac-color);
  color: #fff;
  box-shadow: 0 6px 18px rgba(20, 30, 40, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.smwac__bubble:hover { background: var(--smwac-dark); }
.smwac__bubble:focus-visible,
.smwac__close:focus-visible,
.smwac__btn:focus-visible { outline: 3px solid var(--smwac-dark); outline-offset: 3px; }
.smwac__bubble svg { width: 30px; height: 30px; }

.smwac__panel {
  width: 320px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.smwac--right .smwac__panel { align-items: flex-end; }
.smwac--left .smwac__panel { align-items: flex-start; }
.smwac__panel[hidden] { display: none; }
.smwac__panel.is-in { animation: smwac-in .25s ease-out; }
@keyframes smwac-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .smwac__panel.is-in { animation: none; } }

.smwac__close {
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #5d6b74;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.smwac__close svg { width: 16px; height: 16px; }

.smwac__card {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(20, 30, 40, .22);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
}
.smwac__avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: var(--smwac-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.smwac__who, .smwac__greet, .smwac__msg { margin: 0; }
.smwac__card--noheader .smwac__greet { margin-top: 0; }
.smwac__who { font-size: 14px; }
.smwac__greet { font-weight: 600; margin-top: 4px; }
.smwac__msg { font-size: 14px; color: var(--smwac-muted); margin-top: 4px; white-space: pre-line; }

.smwac__btn {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 22px;
  background: #fff;
  border: 1.5px solid var(--smwac-text);
  color: var(--smwac-text) !important;
  text-decoration: none !important;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(20, 30, 40, .12);
}
.smwac__btn:hover { background: #f1f4f6; }
button.smwac__btn { margin: 0; font-family: inherit; line-height: 1.4; cursor: pointer; }

/* Conversation */
.smwac__scroll {
  width: 100%;
  max-height: calc((100vh - 170px) / var(--smwac-z, 1));
  max-height: calc((100dvh - 170px) / var(--smwac-z, 1));
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 4px 8px;
  margin: -4px -4px 0;
}
.smwac--right .smwac__scroll { align-items: flex-end; }
.smwac--left .smwac__scroll { align-items: flex-start; }
.smwac__thread, .smwac__choices {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.smwac--right .smwac__thread, .smwac--right .smwac__choices { align-items: flex-end; }
.smwac--left .smwac__thread, .smwac--left .smwac__choices { align-items: flex-start; }
.smwac__thread:empty { display: none; }
.smwac__you {
  max-width: 85%;
  padding: 9px 14px;
  border-radius: 18px 18px 4px 18px;
  background: color-mix(in srgb, var(--smwac-color) 16%, #fff);
  color: var(--smwac-text);
  box-shadow: 0 2px 8px rgba(20, 30, 40, .12);
  font-size: 14px;
  align-self: flex-end;
}
.smwac__card--answer { display: block; }
.smwac__card--answer .smwac__msg { margin: 0; color: var(--smwac-text); }
.smwac__typing { width: auto; display: inline-flex; gap: 5px; padding: 14px 16px; align-self: flex-start; }
.smwac__typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #8a98a3;
  animation: smwac-dot 1s infinite ease-in-out;
}
.smwac__typing span:nth-child(2) { animation-delay: .15s; }
.smwac__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes smwac-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .smwac__typing span { animation: none; opacity: .7; } }
.smwac__back {
  min-height: 44px;
  margin: 0;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  color: var(--smwac-text);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}
.smwac__back:focus-visible { outline: 3px solid var(--smwac-dark); outline-offset: 2px; }

/* Optional "unread" dot */
.smwac__bubble { position: relative; }
.smwac__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #c62828;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}
.smwac__btn--primary {
  background: var(--smwac-dark);
  border-color: var(--smwac-dark);
  color: #fff !important;
  font-weight: 600;
}
.smwac__btn--primary:hover { background: color-mix(in srgb, var(--smwac-color) 50%, #000); }

@media (max-width: 767px) {
  .smwac { --smwac-z: var(--smwac-scale-m, var(--smwac-scale, 1)); }
  .smwac--nomobile { display: none; }
  .smwac { bottom: 16px; }
}
@media print { .smwac { display: none; } }
