/* ---------- Website chat (Dee) ---------- */
.dd-chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 70;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px 12px 14px; border: 0; border-radius: 999px;
  background: var(--orange); color: var(--white);
  font: 700 18px/1 var(--display); letter-spacing: .02em; text-transform: uppercase;
  box-shadow: 0 6px 0 var(--orange-dark), 0 10px 30px rgba(0,0,0,.25);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.dd-chat-fab:hover { background: var(--orange-dark); }
.dd-chat-fab:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.dd-chat-fab svg { width: 24px; height: 24px; flex: none; }
.dd-chat-open .dd-chat-fab { display: none; }

.dd-chat {
  position: fixed; right: 20px; bottom: 20px; z-index: 80;
  width: 380px; height: min(620px, calc(100vh - 40px));
  display: none; flex-direction: column; overflow: hidden; padding: 0;
  background: var(--paper); color: var(--ink);
  border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
  font-family: var(--body);
}
.dd-chat-open .dd-chat { display: flex; }

.dd-chat-head {
  display: flex; align-items: center; gap: 12px; flex: none;
  padding: 14px 12px 14px 16px; background: var(--ink); color: var(--white);
}
.dd-chat-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--orange);
  font: 800 20px/1 var(--display);
}
.dd-chat-title { flex: 1; min-width: 0; }
.dd-chat-title strong { display: block; font: 700 20px/1.1 var(--display); letter-spacing: .02em; }
.dd-chat-title span { display: block; font-size: 13px; color: var(--muted-dark); margin-top: 2px; }
.dd-chat-close {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: 10px;
  background: transparent; color: var(--white); cursor: pointer;
  display: grid; place-items: center;
}
.dd-chat-close:hover, .dd-chat-close:focus-visible { background: rgba(255,255,255,.12); outline: none; }
.dd-chat-close svg { width: 22px; height: 22px; }

.dd-chat-log {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.dd-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 16px;
  font-size: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.dd-msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.dd-msg-agent { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.dd-msg-agent a { color: var(--orange-dark); font-weight: 600; }
.dd-msg a[href^="tel:"] { white-space: nowrap; }
.dd-msg-user { align-self: flex-end; background: var(--ink); color: var(--white); border-bottom-right-radius: 4px; }
.dd-msg-note { align-self: center; max-width: 100%; font-size: 13px; color: var(--muted); text-align: center; padding: 2px 8px; }

.dd-typing { display: inline-flex; gap: 4px; align-items: center; height: 20px; }
.dd-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dd-blink 1.2s infinite ease-in-out; }
.dd-typing i:nth-child(2) { animation-delay: .15s; }
.dd-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dd-blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.dd-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 10px; flex: none; }
.dd-chip {
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  border-radius: 999px; padding: 8px 14px; min-height: 40px;
  font: 600 15px/1.2 var(--body); cursor: pointer;
}
.dd-chip:hover, .dd-chip:focus-visible { background: var(--ink); color: var(--white); outline: none; }

.dd-chat-form {
  display: flex; gap: 8px; align-items: flex-end; flex: none;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--white); border-radius: 0;
}
.dd-chat-input {
  flex: 1; min-width: 0; resize: none; max-height: 120px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px;
  font: 16px/1.35 var(--body); color: var(--ink); background: var(--white);
}
.dd-chat-input:focus { outline: none; border-color: var(--orange); }
.dd-chat-send {
  width: 46px; height: 46px; flex: none; border: 0; border-radius: 12px;
  background: var(--orange); color: var(--white); cursor: pointer;
  display: grid; place-items: center;
}
.dd-chat-send:disabled { opacity: .45; cursor: default; }
.dd-chat-send svg { width: 22px; height: 22px; }
.dd-chat-foot { font-size: 12px; color: var(--muted); text-align: center; padding: 0 12px 8px; background: var(--white); flex: none; }
.dd-chat-foot a { color: inherit; }

@media (max-width: 760px) {
  /* Sit above the sticky mobile bar */
  .dd-chat-fab {
    right: 16px; bottom: calc(98px + env(safe-area-inset-bottom));
    padding: 0; width: 58px; height: 58px; justify-content: center;
  }
  .dd-chat-fab span { display: none; }
  .dd-chat-fab svg { width: 28px; height: 28px; }
  /* Full screen on phones; height follows the visible area when the keyboard opens */
  .dd-chat {
    inset: 0; right: 0; bottom: auto; width: 100%;
    height: var(--dd-vh, 100dvh); max-height: none; border-radius: 0;
  }
  .dd-chat-head { padding-top: calc(12px + env(safe-area-inset-top)); }
  .dd-msg { max-width: 88%; }
  body.dd-chat-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .dd-typing i { animation: none; opacity: .6; }
}
