/* DARTIC Chatbot widget - all rules scoped to .dcb-root */
.dcb-root {
  --dcb-color: #1F4E79;
  --dcb-on-color: #ffffff;
  --dcb-offset: 20px;
  --dcb-width: 370px;
  --dcb-height: 540px;
  --dcb-font: 14px;
  position: fixed;
  bottom: var(--dcb-offset);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--dcb-font);
  line-height: 1.45;
}
.dcb-root.dcb-pos-right { right: var(--dcb-offset); align-items: flex-end; }
.dcb-root.dcb-pos-left { left: var(--dcb-offset); align-items: flex-start; }
.dcb-root *, .dcb-root *::before, .dcb-root *::after { box-sizing: border-box; }

/* ---- launcher ---- */
.dcb-root .dcb-launcher {
  height: 58px; min-width: 58px; border-radius: 29px; border: 0; cursor: pointer;
  background: var(--dcb-color); color: var(--dcb-on-color);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0;
  box-shadow: 0 6px 18px rgba(0,0,0,.22); transition: transform .15s ease;
  font: 600 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.dcb-root .dcb-launcher:hover { transform: scale(1.05); }
.dcb-root .dcb-launcher svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.dcb-root .dcb-launcher-label { padding: 0 20px 0 16px; }
.dcb-root .dcb-launcher-logo { padding: 4px; }
.dcb-root .dcb-launcher-logo.dcb-launcher-label { padding: 4px 20px 4px 4px; }
.dcb-root .dcb-launcher-img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; background: #fff; flex: none; }
.dcb-root .dcb-launcher-text { white-space: nowrap; }

/* ---- panel ---- */
.dcb-root .dcb-panel {
  width: var(--dcb-width); height: var(--dcb-height); max-width: calc(100vw - 2 * var(--dcb-offset));
  max-height: calc(100vh - 110px);
  background: #fff; color: #1d1d1f; border-radius: 14px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.25); margin-bottom: 12px;
  display: flex; flex-direction: column;
}
.dcb-root .dcb-panel[hidden] { display: none; }

.dcb-root .dcb-header {
  background: var(--dcb-color); color: var(--dcb-on-color); padding: 10px 8px 10px 14px;
  display: flex; align-items: center; gap: 10px;
}
.dcb-root .dcb-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #fff; flex: none; }
.dcb-root .dcb-titles { flex: 1; min-width: 0; }
.dcb-root .dcb-title { font-weight: 600; font-size: 1.07em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcb-root .dcb-subtitle { font-size: .8em; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcb-root .dcb-hbtn {
  background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 17px;
  width: 32px; height: 32px; border-radius: 6px; padding: 0; line-height: 1; flex: none;
}
.dcb-root .dcb-hbtn:hover { background: rgba(127,127,127,.2); }

.dcb-root .dcb-messages {
  flex: 1; overflow-y: auto; padding: 14px; background: #f5f6f8;
  display: flex; flex-direction: column; gap: 8px;
}
.dcb-root .dcb-msg { max-width: 85%; padding: 9px 12px; border-radius: 12px; white-space: pre-wrap; word-wrap: break-word; }
.dcb-root .dcb-assistant { background: #fff; border: 1px solid #e3e5e8; align-self: flex-start; border-bottom-left-radius: 4px; }
.dcb-root .dcb-user { background: var(--dcb-color); color: var(--dcb-on-color); align-self: flex-end; border-bottom-right-radius: 4px; }
.dcb-root .dcb-error { background: #fdecea; color: #8a1c12; border: 1px solid #f5c2bd; align-self: flex-start; }
.dcb-root .dcb-notice { background: #fff8e5; color: #6b4e00; border: 1px solid #f0d78c; align-self: flex-start; }
.dcb-root .dcb-msg a { color: inherit; text-decoration: underline; }
.dcb-root .dcb-assistant a { color: var(--dcb-color); }

.dcb-root .dcb-suggestions { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 100%; }
.dcb-root .dcb-chip {
  border: 1px solid var(--dcb-color); color: var(--dcb-color); background: #fff; border-radius: 16px;
  padding: 6px 12px; font: inherit; font-size: .93em; cursor: pointer; text-align: left; line-height: 1.3;
}
.dcb-root .dcb-chip:hover { background: var(--dcb-color); color: var(--dcb-on-color); }

.dcb-root .dcb-typing { min-height: 36px; color: #5f6368; font-size: .93em; }
.dcb-root .dcb-step { display: flex; align-items: center; gap: 8px; line-height: 1.4; }
.dcb-root .dcb-step + .dcb-step { margin-top: 4px; }
.dcb-root .dcb-step-done { color: #8a8f94; }
.dcb-root .dcb-step-now { color: #3c4043; }
.dcb-root .dcb-step-text { flex: 1; }
.dcb-root .dcb-timer { color: #9aa0a6; font-size: .9em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dcb-root .dcb-dots { display: inline-flex; gap: 3px; flex: none; }
.dcb-root .dcb-dots i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--dcb-color); opacity: .35; display: inline-block;
  animation: dcb-bounce 1.2s infinite ease-in-out;
}
.dcb-root .dcb-dots i:nth-child(2) { animation-delay: .15s; }
.dcb-root .dcb-dots i:nth-child(3) { animation-delay: .3s; }
.dcb-root .dcb-meta { align-self: flex-start; font-size: .8em; color: #8a8f94; margin: 2px 0 -4px 4px; }
@keyframes dcb-bounce { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.dcb-root .dcb-disclaimer { font-size: 11px; color: #6b7075; padding: 6px 14px; background: #fff; border-top: 1px solid #eceef0; }

.dcb-root .dcb-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #eceef0; background: #fff; margin: 0; }
.dcb-root .dcb-input {
  flex: 1; resize: none; border: 1px solid #d0d4d9; border-radius: 10px; padding: 9px 11px;
  font: inherit; color: inherit; background: #fff; min-height: 40px; max-height: 120px; outline: none; margin: 0;
}
.dcb-root .dcb-input:focus { border-color: var(--dcb-color); }
.dcb-root .dcb-send {
  width: 42px; height: 40px; border: 0; border-radius: 10px; background: var(--dcb-color); color: var(--dcb-on-color);
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; align-self: flex-end; flex: none;
}
.dcb-root .dcb-send:disabled { opacity: .5; cursor: default; }
.dcb-root .dcb-send svg { width: 18px; height: 18px; fill: currentColor; }

/* ---- phones ---- */
@media (max-width: 480px) {
  .dcb-root.dcb-hide-mobile { display: none; }
  .dcb-root.dcb-open { left: 8px; right: 8px; bottom: 8px; align-items: stretch; }
  .dcb-root.dcb-open .dcb-panel { width: 100%; max-width: none; height: calc(100vh - 90px); max-height: none; }
  .dcb-root.dcb-open .dcb-launcher { align-self: flex-end; }
}

/* ---- source links ---- */
.dcb-root .dcb-sources { align-self: flex-start; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 92%; margin-top: -2px; font-size: .86em; }
.dcb-root .dcb-sources-label { color: #6b7075; }
.dcb-root .dcb-source {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  background: #fff; border: 1px solid #e3e5e8; border-radius: 14px; padding: 3px 10px;
  color: var(--dcb-color); text-decoration: none;
}
.dcb-root .dcb-source:hover { border-color: var(--dcb-color); }
.dcb-root .dcb-source span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.dcb-root .dcb-source-img { padding-left: 3px; }
.dcb-root .dcb-source img { width: 26px; height: 26px; border-radius: 10px; object-fit: cover; flex: none; }
