/* TVD Chatbot (minimal, scoped) */
:root{
  /* If your page already defines these, it will inherit. */
  --tvd-bot-bg: #ffffff;
  --tvd-bot-text: #1f2033;
  --tvd-bot-border: rgba(17, 24, 39, 0.12);
  --tvd-bot-shadow: 0 16px 40px rgba(0,0,0,0.14);
  --tvd-bot-radius: 16px;
  --tvd-bot-accent: var(--tvd-primary, #a42354);
  --tvd-bot-accent-2: var(--tvd-secondary, #fc4240);
}

.tvd-bot-fab{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: none; /* shown by JS after delay */
  gap: 10px;
  align-items: center;
}

.tvd-bot-fab button{
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--tvd-bot-accent), var(--tvd-bot-accent-2));
  color: #fff;
  box-shadow: var(--tvd-bot-shadow);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: inherit;
}

.tvd-bot-fab .tvd-bot-pill{
  background: rgba(255,255,255,0.9);
  color: var(--tvd-bot-text);
  border: 1px solid var(--tvd-bot-border);
  padding: 10px 12px;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.10);
  font-size: 14px;
  max-width: 240px;
}

.tvd-bot-panel{
  position: fixed;
  right: 18px;
  bottom: 78px;
  z-index: 9999;
  width: 360px;
  max-width: calc(100vw - 36px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: var(--tvd-bot-bg);
  border: 1px solid var(--tvd-bot-border);
  border-radius: var(--tvd-bot-radius);
  box-shadow: var(--tvd-bot-shadow);
  display: none;
  overflow: hidden;
}

.tvd-bot-panel[aria-hidden="false"]{ display: flex; flex-direction: column; }

.tvd-bot-header{
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--tvd-bot-border);
  background: linear-gradient(135deg, rgba(164,35,84,0.08), rgba(252,66,64,0.06));
}

.tvd-bot-title{
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.tvd-bot-title strong{ font-size: 14px; color: var(--tvd-bot-text); }
.tvd-bot-title span{ font-size: 12px; opacity: .75; }

.tvd-bot-close{
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 10px;
}

.tvd-bot-body{
  padding: 12px;
  flex: 1;
  overflow: auto;
}

.tvd-bot-msg{
  display: flex;
  margin: 10px 0;
  gap: 8px;
}
.tvd-bot-msg.bot{ justify-content: flex-start; }
.tvd-bot-msg.user{ justify-content: flex-end; }

.tvd-bot-bubble{
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--tvd-bot-border);
  font-size: 14px;
  line-height: 1.35;
  background: #fff;
  color: var(--tvd-bot-text);
}

.tvd-bot-msg.user .tvd-bot-bubble{
  background: rgba(164,35,84,0.10);
  border-color: rgba(164,35,84,0.18);
}

.tvd-bot-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tvd-bot-chip{
  border: 1px solid var(--tvd-bot-border);
  background: #fff;
  color: var(--tvd-bot-text);
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
}

.tvd-bot-footer{
  border-top: 1px solid var(--tvd-bot-border);
  padding: 10px;
  display: flex;
  gap: 8px;
}

.tvd-bot-input{
  flex: 1;
  border: 1px solid var(--tvd-bot-border);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  font: inherit;
  font-size: 14px;
}

.tvd-bot-send{
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--tvd-bot-accent), var(--tvd-bot-accent-2));
}

.tvd-bot-meta{
  font-size: 11px;
  opacity: 0.7;
  margin-top: 6px;
}

/* Mobile: bottom sheet style */
@media (max-width: 520px){
  .tvd-bot-panel{
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    height: 70vh;
    max-height: 80vh;
    border-radius: 18px;
  }
  .tvd-bot-fab{ right: 12px; bottom: 12px; }
  .tvd-bot-fab .tvd-bot-pill{ display: none; } /* keep clean on mobile */
}
