/* # assets/chat.css */
#ab-dsc-root {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 999999;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

.dsc-bubble {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #ff4400;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  user-select: none;
}

.dsc-bubble i {
  font-size: 22px;
  line-height: 1;
}

.dsc-panel {
  position: absolute;
  right: 0;
  bottom: 68px;

  width: 340px;
  max-width: calc(100vw - 36px);

  height: min(560px, calc(var(--ab-dsc-vh, 1vh) * 100 - 140px));

  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  overflow: hidden;
  display: none;
  border: 1px solid rgba(0,0,0,.08);

  flex-direction: column;
}

.dsc-panel.open {
  display: flex;
}

.dsc-head {
  height: 48px;
  background: #0f172a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  flex: 0 0 auto;
}

.dsc-title {
  font-weight: 600;
  font-size: 14px;
}

.dsc-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.dsc-body {
  padding: 10px;
  overflow: auto;
  background: #f8fafc;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}

.dsc-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dsc-msg {
  max-width: 92%;
}

.dsc-meta {
  font-size: 11px;
  opacity: .65;
  margin-bottom: 4px;
}

.dsc-text {
  font-size: 13px;
  line-height: 1.35;
  background: #fff;
  border: 1px solid rgba(0,0,0,.07);
  padding: 8px 10px;
  border-radius: 10px;
  white-space: normal;
  word-break: break-word;
}

.dsc-text a {
  color: #0b5bd3;
  text-decoration: underline;
}

.dsc-text a:hover {
  color: #0b5bd3;
  text-decoration: none;
}

.dsc-user {
  align-self: flex-end;
}

.dsc-user .dsc-text {
  background: #ffe6dc;
  border-color: rgba(255,68,0,.25);
}

.dsc-operator .dsc-text {
  background: #fff;
  border-color: rgba(0,0,0,.07);
}

.dsc-typing .dsc-text {
  font-style: italic;
  opacity: .75;
}

.dsc-foot {
  border-top: 1px solid rgba(0,0,0,.08);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;

  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

#dsc-input {
  width: 100%;
  resize: none;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 10px;
  padding: 8px;
  font-size: 13px;
  min-height: 44px;
  max-height: 96px;
}

.dsc-actions {
  display: flex;
  gap: 8px;
}

#dsc-send, #dsc-end {
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
}

#dsc-send {
  background: #ff4400;
  color: #fff;
  flex: 1;
}

#dsc-end {
  background: #e2e8f0;
  color: #0f172a;
}

.dsc-captcha-wrap {
  border: 1px dashed rgba(0,0,0,.25);
  border-radius: 10px;
  padding: 8px;
  background: #fff;

  max-height: 240px;
  overflow: auto;
}

.dsc-captcha-title {
  font-size: 12px;
  margin-bottom: 6px;
  opacity: .8;
}

@media (max-width: 480px) {
  #ab-dsc-root {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .dsc-bubble {
    width: 52px;
    height: 52px;
  }

  .dsc-panel {
    width: calc(100vw - 24px);

    /* Less tall on mobile so the input stays usable with the keyboard */
    height: clamp(320px, calc(var(--ab-dsc-vh, 1vh) * 60), 460px);
    max-height: calc(var(--ab-dsc-vh, 1vh) * 100 - 160px);
  }

  #dsc-input {
    font-size: 16px;
    max-height: 76px;
  }
}