/* DITC Chat Widget */
#ditc-chat-root {
  --chat-brand: #0f766e;
  --chat-brand-dark: #0b5d56;
  --chat-bg: #ffffff;
  --chat-ink: #1f2937;
  --chat-ink-soft: #6b7280;
  position: fixed;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
#ditc-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100000;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--chat-brand), var(--chat-brand-dark));
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
#ditc-chat-launcher:hover { transform: scale(1.08); }
#ditc-chat-launcher .msg-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
#ditc-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 92px;
  z-index: 100000;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--chat-bg);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
#ditc-chat-panel.open { display: flex; }
#ditc-chat-head {
  background: linear-gradient(135deg, var(--chat-brand), var(--chat-brand-dark));
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
#ditc-chat-head .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex: none;
}
#ditc-chat-head .title { font-weight: 700; font-size: 14px; }
#ditc-chat-head .subtitle { font-size: 11px; opacity: 0.9; }
#ditc-chat-close { margin-left: auto; cursor: pointer; font-size: 20px; opacity: 0.85; border: none; background: none; color: #fff; }
#ditc-chat-close:hover { opacity: 1; }
#ditc-chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f6f8f9; }
#ditc-chat-body::-webkit-scrollbar { width: 6px; }
#ditc-chat-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.ditc-msg { max-width: 80%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.ditc-msg.bot { background: #fff; color: var(--chat-ink); border-top-left-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); align-self: flex-start; }
.ditc-msg.user { background: var(--chat-brand); color: #fff; border-top-right-radius: 4px; align-self: flex-end; }
.ditc-msg .typing::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 4px; background: #9ca3af; border-radius: 50%; animation: ditcBlink 1s infinite; }
@keyframes ditcBlink { 0%,100%{opacity:.2} 50%{opacity:1} }
.ditc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; align-self: flex-start; }
.ditc-chip {
  border: 1px solid var(--chat-brand);
  color: var(--chat-brand);
  background: #fff;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.ditc-chip:hover { background: var(--chat-brand); color: #fff; }
#ditc-chat-inputbar { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #eee; background: #fff; }
#ditc-chat-input {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  outline: none;
  background: #f9fafb;
}
#ditc-chat-input:focus { border-color: var(--chat-brand); background: #fff; }
#ditc-chat-send {
  border: none;
  background: var(--chat-brand);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  flex: none;
}
#ditc-chat-send:hover { background: var(--chat-brand-dark); }
