#lwl-megan {
  --megan-accent: #8e1b2e;
  --megan-surface: #ffffff;
  --megan-ink: #1f1e1c;
  --megan-border: #d4d2cb;
  --megan-shadow: 0 4px 16px #1f1e1c22;
  --megan-shadow-hover: 0 8px 22px #1f1e1c30;
  --megan-muted: #6c6869;
  --megan-live: #258453;
  --megan-soft: #f7f5f5;
  --megan-lift: 0px;
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--megan-lift));
  z-index: 999999;
  font-family: Poppins, "Schibsted Grotesk", system-ui, sans-serif;
  letter-spacing: 0;
  max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; align-items: flex-end;
  transition: bottom 220ms ease;
  opacity: 0;
  transform: translateY(10px);
  animation: megan-enter 420ms ease 120ms forwards;
}
#lwl-megan * { box-sizing: border-box; }
#lwl-megan .megan-btn {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--megan-border); border-radius: 999px; height: 50px; width: 172px; padding: 5px 5px 5px 14px;
  background: var(--megan-surface) !important; color: var(--megan-ink) !important;
  box-shadow: var(--megan-shadow); font: 600 12.5px/1.3 Poppins, system-ui, sans-serif;
  cursor: pointer; letter-spacing: 0;
  transition: box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}
#lwl-megan .megan-btn::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 0 #8e1b2e70; opacity: 0; pointer-events: none;
}
#lwl-megan[data-state="idle"] .megan-btn::before { animation: megan-radiate 1.5s ease-out infinite; }
#lwl-megan[data-state="idle"] .megan-btn:hover::before { animation-play-state: paused; opacity: 0; }
#lwl-megan .megan-btn:hover { background: var(--megan-soft) !important; box-shadow: var(--megan-shadow-hover); transform: translateY(-2px); }
#lwl-megan .megan-btn:active { transform: translateY(0); }
#lwl-megan .megan-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-width: 0; }
#lwl-megan .megan-copy strong { font-size: 13px; line-height: 1.15; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
#lwl-megan .megan-ai-tag { display: inline-flex; align-items: center; padding: 1px 5px; border-radius: 999px; background: #FDF2F4; border: 1px solid #F3D1D8; color: #8e1b2e; font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; line-height: 1.2; }
#lwl-megan .megan-timer { color: var(--megan-muted); font-size: 10px; font-weight: 400; font-variant-numeric: tabular-nums; margin-left: 4px; }
#lwl-megan .megan-call-label { color: var(--megan-muted); font-size: 10px; font-weight: 400; white-space: nowrap; line-height: 1.3; transition: color 180ms ease; }
#lwl-megan .megan-icon { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: var(--megan-accent); color: var(--megan-surface); transition: background 180ms ease; }
#lwl-megan[data-state="live"] .megan-call-label { color: var(--megan-live); }
#lwl-megan[data-state="live"] .megan-call-label::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--megan-live); margin-right: 4px; vertical-align: 1px; }
#lwl-megan[data-state="calling"] .megan-icon svg { animation: megan-ring 650ms ease-in-out infinite; }
#lwl-megan[data-state="connecting"] .megan-icon,
#lwl-megan[data-state="waiting"] .megan-icon { position: relative; }
#lwl-megan[data-state="connecting"] .megan-icon::after,
#lwl-megan[data-state="waiting"] .megan-icon::after { content: ""; position: absolute; inset: -3px; border: 2px solid var(--megan-border); border-top-color: var(--megan-accent); border-radius: 50%; animation: megan-spin 1.4s linear infinite; }
#lwl-megan[data-state="waiting"] .megan-icon::after { animation-duration: 3s; }
#lwl-megan[data-state="live"] .megan-call-label::before { animation: megan-breathe 2s ease-in-out infinite; }
@keyframes megan-enter { to { opacity: 1; transform: translateY(0); } }
@keyframes megan-ring { 20%, 60% { transform: rotate(-12deg); } 40%, 80% { transform: rotate(12deg); } }
@keyframes megan-spin { to { transform: rotate(360deg); } }
@keyframes megan-breathe { 50% { opacity: .45; } }
@keyframes megan-radiate {
  0% { box-shadow: 0 0 0 0 #8e1b2e70; opacity: .9; }
  70%, 100% { box-shadow: 0 0 0 11px #8e1b2e00; opacity: 0; }
}
@keyframes megan-leave { to { opacity: 0; transform: translateX(14px); } }
@media (prefers-reduced-motion: reduce) {
  #lwl-megan { animation: none; opacity: 1; transform: none; }
  #lwl-megan *, #lwl-megan *::before, #lwl-megan *::after { animation: none !important; }
  #lwl-megan .megan-btn { transition: none; }
}
#lwl-megan .megan-btn:focus-visible { outline: 3px solid var(--megan-accent); outline-offset: 3px; }
#lwl-megan .megan-btn:disabled { cursor: wait; }
#lwl-megan svg { width: 18px; height: 18px; flex: 0 0 18px; }
#lwl-megan [role="status"] {
  display: none; background: var(--megan-surface); color: var(--megan-ink);
  border: 1px solid var(--megan-border); border-radius: 8px;
  box-shadow: var(--megan-shadow); padding: 8px 12px; margin-bottom: 8px;
  width: max-content; max-width: min(220px, calc(100vw - 32px));
  font-size: 11px; line-height: 1.45;
  overflow-wrap: anywhere;
  animation: megan-enter 220ms ease forwards;
}
#lwl-megan [role="status"]:not(:empty) { display: block; }
#lwl-megan [role="status"].leaving { animation: megan-leave 260ms ease forwards; }
#lwl-megan .megan-action[hidden] { display: none; }
#lwl-megan .megan-action {
  display: flex; align-items: center; gap: 10px;
  background: var(--megan-surface); border: 1px solid var(--megan-accent);
  border-radius: 999px; box-shadow: var(--megan-shadow-hover);
  padding: 6px 8px 6px 16px; margin-bottom: 10px;
  max-width: min(320px, calc(100vw - 32px));
  animation: megan-enter 260ms ease forwards, megan-action-pulse 2.4s ease-in-out 1;
}
#lwl-megan .megan-action-label {
  font-size: 12.5px; font-weight: 600; color: var(--megan-ink); line-height: 1.3;
  flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; text-overflow: ellipsis;
}
#lwl-megan .megan-action-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  background: var(--megan-accent) !important; color: var(--megan-surface) !important;
  font: 700 12px/1 Poppins, system-ui, sans-serif; text-decoration: none;
  border-radius: 999px; padding: 9px 14px; white-space: nowrap;
  transition: background 150ms ease, transform 150ms ease;
}
#lwl-megan .megan-action-btn:hover { background: #a3263e !important; transform: translateY(-1px); }
#lwl-megan .megan-action-close {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: transparent; color: var(--megan-muted); font-size: 16px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
#lwl-megan .megan-action-close:hover { background: var(--megan-soft); color: var(--megan-ink); }
@keyframes megan-action-pulse {
  0%, 100% { box-shadow: var(--megan-shadow-hover); }
  50% { box-shadow: 0 0 0 6px #8e1b2e22, var(--megan-shadow-hover); }
}
@media (max-width: 600px) {
  #lwl-megan {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + var(--megan-lift));
  }
  #lwl-megan .megan-btn {
    height: 38px;
    width: auto;
    min-width: 0;
    gap: 6px;
    padding: 3px 4px 3px 10px;
  }
  #lwl-megan[data-state="idle"] .megan-call-label {
    display: none;
  }
  #lwl-megan .megan-copy strong {
    font-size: 11.5px;
  }
  #lwl-megan .megan-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
  }
  #lwl-megan svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
  }
  #lwl-megan .megan-action {
    max-width: min(260px, calc(100vw - 24px));
    padding: 5px 5px 5px 12px;
    gap: 6px;
  }
  #lwl-megan .megan-action-label {
    font-size: 12px;
  }
  #lwl-megan .megan-action-btn {
    padding: 8px 11px;
    font-size: 11.5px;
    gap: 3px;
  }
  #lwl-megan .megan-action-close {
    width: 24px;
    height: 24px;
    font-size: 15px;
  }
}
