/* Teeth Q Smile Assistant — widget styles v1.0.1 (bubble moved to bottom-left to clear phone/WhatsApp stack) */
.tqchat-root {
  --tq-teal: #0e6e66;
  --tq-teal-dark: #0a524c;
  --tq-teal-soft: #e3f1ef;
  --tq-porcelain: #f7faf9;
  --tq-ink: #1c3330;
  --tq-ink-soft: #5b7370;
  --tq-line: #dce8e6;
  --tq-amber: #e8a13d;
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  position: fixed;
  z-index: 999999;
  left: 20px;
  bottom: 20px;
}
.tqchat-root, .tqchat-root * { box-sizing: border-box; margin: 0; padding: 0; }

/* Bubble */
.tqchat-bubble {
  display: flex; align-items: center; gap: 10px;
  background: var(--tq-teal); color: #fff; border: 0; cursor: pointer;
  padding: 12px 18px 12px 12px; border-radius: 999px;
  box-shadow: 0 6px 24px rgba(14, 110, 102, 0.35);
  font-size: 15px; font-weight: 600; font-family: inherit;
  transition: transform 0.15s ease, opacity 0.2s ease;
}
.tqchat-bubble:hover { transform: translateY(-2px); }
.tqchat-bubble.tqchat-hidden { opacity: 0; pointer-events: none; }
.tqchat-bubble-q {
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; color: var(--tq-teal);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px;
}

/* Panel */
.tqchat-panel {
  position: absolute; left: 0; bottom: 0;
  width: 380px; max-width: calc(100vw - 24px);
  height: 600px; max-height: calc(100vh - 40px); /* fallback */
  max-height: calc(100dvh - 40px);
  background: #fff; border: 1px solid var(--tq-line); border-radius: 22px;
  box-shadow: 0 12px 48px rgba(28, 51, 48, 0.22);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.tqchat-panel.tqchat-open { opacity: 1; pointer-events: auto; transform: translateY(0); }

@media (max-width: 480px) {
  .tqchat-root { left: 12px; bottom: 12px; }
  .tqchat-panel {
    position: fixed; inset: 0; width: 100%; height: 100%;
    max-width: 100%; max-height: 100%; border-radius: 0; border: 0;
  }
}

/* Header */
.tqchat-header {
  display: flex; align-items: center; gap: 12px;
  background: var(--tq-teal); padding: 14px 16px; flex-shrink: 0;
}
.tqchat-mark {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: var(--tq-teal);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
}
.tqchat-hmeta { flex: 1; min-width: 0; }
.tqchat-htitle { color: #fff; font-weight: 600; font-size: 15px; line-height: 1.2; }
.tqchat-hsub { color: #cfe7e3; font-size: 12px; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.tqchat-dot { width: 7px; height: 7px; border-radius: 50%; background: #7fd8a4; display: inline-block; }
.tqchat-close {
  background: none; border: 0; color: #cfe7e3; font-size: 26px; line-height: 1;
  cursor: pointer; padding: 4px 8px; font-family: inherit;
}
.tqchat-close:hover { color: #fff; }

/* Messages */
.tqchat-scroll { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.tqchat-row { display: flex; }
.tqchat-left { justify-content: flex-start; }
.tqchat-right { justify-content: flex-end; }
.tqchat-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 16px;
  font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word;
}
.tqchat-bot { background: var(--tq-teal-soft); color: var(--tq-ink); border-bottom-left-radius: 6px; }
.tqchat-user { background: var(--tq-teal); color: #fff; border-bottom-right-radius: 6px; }

/* Typing dots */
.tqchat-typing { display: flex; align-items: center; gap: 4px; padding: 12px 16px; }
.tqchat-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--tq-teal);
  animation: tqchat-bounce 1s infinite;
}
.tqchat-typing span:nth-child(2) { animation-delay: 0.15s; }
.tqchat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tqchat-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

/* Booking card */
.tqchat-card { border: 1px solid var(--tq-line); border-radius: 16px; overflow: hidden; max-width: 90%; background: #fff; }
.tqchat-card-head {
  background: var(--tq-teal-dark); padding: 8px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.tqchat-card-title { color: #fff; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; }
.tqchat-card-badge {
  background: var(--tq-amber); color: var(--tq-teal-dark);
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.tqchat-card-body { padding: 10px 14px; }
.tqchat-card-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 13px; }
.tqchat-card-k { color: var(--tq-ink-soft); }
.tqchat-card-v { color: var(--tq-ink); font-weight: 500; text-align: right; }
.tqchat-card-note { margin-top: 8px; font-size: 11.5px; color: var(--tq-ink-soft); }

/* Chips */
.tqchat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 10px; flex-shrink: 0; background: #fff; }
.tqchat-chip {
  background: #fff; color: var(--tq-teal); border: 1.5px solid var(--tq-teal);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}
.tqchat-chip:hover { background: var(--tq-teal-soft); }

/* Input */
.tqchat-inputrow {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--tq-line); flex-shrink: 0; background: #fff;
}
.tqchat-input {
  flex: 1; resize: none; border: 1px solid var(--tq-line); border-radius: 16px;
  background: var(--tq-porcelain); color: var(--tq-ink);
  padding: 10px 14px; font-size: 14px; font-family: inherit; line-height: 1.4;
  outline: none; max-height: 96px;
}
.tqchat-input:focus { border-color: var(--tq-teal); }
.tqchat-send {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--tq-teal); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tqchat-send:disabled { opacity: 0.4; cursor: default; }

/* Footer */
.tqchat-foot {
  padding: 8px 16px 12px; font-size: 10.5px; line-height: 1.4;
  color: var(--tq-ink-soft); background: #fff; flex-shrink: 0;
}
