.dee-live-chat {
  --dlc-teal: #0d4f4a;
  --dlc-green: #0E8A43;
  --dlc-ink: #0f172a;
  --dlc-muted: #64748b;
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9998;
  font-family: "DM Sans", "Segoe UI", sans-serif;
}
.dee-live-chat__fab {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #12756d, var(--dlc-teal));
  color: #fff;
  box-shadow: 0 12px 28px rgba(13, 79, 74, 0.35);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.dee-live-chat__fab:hover { transform: translateY(-2px); }
.dee-live-chat__fab svg { width: 26px; height: 26px; }
.dee-live-chat__panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(360px, calc(100vw - 28px));
  height: min(520px, calc(100vh - 120px));
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition: opacity .2s ease, transform .2s ease;
}
.dee-live-chat.is-open .dee-live-chat__panel {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.dee-live-chat__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #0b3d39, var(--dlc-teal));
  color: #fff;
}
.dee-live-chat__head img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fff;
  padding: 3px;
  object-fit: contain;
}
.dee-live-chat__head strong { display: block; font-size: 0.95rem; }
.dee-live-chat__head small { opacity: .8; font-size: 0.72rem; }
.dee-live-chat__close {
  margin-left: auto;
  border: 0;
  background: rgba(255,255,255,.15);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.dee-live-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: linear-gradient(180deg, #f8fafc, #fff);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dee-live-chat__bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--dlc-ink);
}
.dee-live-chat__bubble--bot {
  align-self: flex-start;
  background: #eef6f4;
  border: 1px solid #d5e8e4;
}
.dee-live-chat__bubble--user {
  align-self: flex-end;
  background: var(--dlc-green);
  color: #fff;
}
.dee-live-chat__typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: 10px 14px;
  background: #eef6f4;
  border-radius: 14px;
}
.dee-live-chat__typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6b908a;
  animation: dlcDot 1s infinite ease-in-out;
}
.dee-live-chat__typing i:nth-child(2) { animation-delay: .15s; }
.dee-live-chat__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dlcDot {
  0%, 80%, 100% { opacity: .35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.dee-live-chat__suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 8px;
}
.dee-live-chat__chip {
  border: 1px solid #d5e0de;
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dlc-teal);
  cursor: pointer;
}
.dee-live-chat__form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #eef2f1;
}
.dee-live-chat__form input {
  flex: 1;
  border: 1px solid #d5e0de;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
}
.dee-live-chat__form button {
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  background: var(--dlc-teal);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* Keep clear of patient SOS FAB and bottom nav */
.pp-app .dee-live-chat {
  bottom: max(88px, calc(72px + env(safe-area-inset-bottom)));
  right: max(14px, env(safe-area-inset-right));
}
.pp-app .pp-sos-fab {
  right: max(14px, env(safe-area-inset-right));
  bottom: max(148px, calc(130px + env(safe-area-inset-bottom)));
}

@media (max-width: 480px) {
  .dee-live-chat__panel {
    width: calc(100vw - 20px);
    height: min(70vh, 560px);
    right: -2px;
  }
}
