.doris-chat {
  --chat-color: #45382e;
  --chat-ink: #332b25;
  --chat-line: #e8dfd5;
  --chat-paper: #fcfaf7;
  position: fixed;
  right: 28px;
  bottom: 26px;
  z-index: 9998;
  color: var(--chat-ink);
  font-family: inherit;
}

.doris-chat-launcher {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 56px;
  padding: 7px 21px 7px 8px;
  border: 1px solid #ffffff36;
  border-radius: 999px;
  background: var(--chat-color);
  color: #fff;
  box-shadow: 0 12px 34px #241b1638;
  font: inherit;
  font-size: 12px;
  letter-spacing: .025em;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}

.doris-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px #241b1647;
}

.doris-chat-launcher:focus-visible,
.doris-chat-close:focus-visible,
.doris-chat-question:focus-visible,
.doris-chat-compose button:focus-visible {
  outline: 2px solid #b89a78;
  outline-offset: 3px;
}

.doris-chat-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #ffffff35;
  border-radius: 50%;
  background: #ffffff12;
  font-size: 18px;
}

.doris-chat-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: flex;
  width: min(390px, calc(100vw - 32px));
  height: min(610px, calc(100vh - 120px));
  min-height: 420px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dfd5ca;
  border-radius: 21px;
  background: var(--chat-paper);
  box-shadow: 0 24px 76px #241b162e, 0 3px 12px #241b160c;
  animation: doris-chat-enter .24s ease both;
}

.doris-chat-panel[hidden] { display: none; }

.doris-chat-panel > header {
  position: relative;
  display: flex;
  min-height: 91px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 21px 18px 76px;
  background: var(--chat-color);
  color: #fff;
}

.doris-chat-panel > header::before {
  position: absolute;
  left: 21px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #ffffff45;
  border-radius: 50%;
  color: #fff;
  content: "D";
  font-family: Georgia, serif;
  font-size: 20px;
  font-style: italic;
}

.doris-chat-panel header div { display: grid; gap: 6px; }

.doris-chat-panel header small {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ffffffb8;
  font-size: 8px;
  letter-spacing: .17em;
}

.doris-chat-panel header small::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a9c49a;
  box-shadow: 0 0 0 3px #a9c49a25;
  content: "";
}

.doris-chat-panel header strong { font-size: 15px; font-weight: 500; letter-spacing: .01em; }

.doris-chat-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #ffffff35;
  border-radius: 50%;
  background: #ffffff0b;
  color: #fff;
  font: inherit;
  font-size: 21px;
  cursor: pointer;
  transition: background .2s ease;
}

.doris-chat-close:hover { background: #ffffff20; }

.doris-chat-log {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 11px;
  overflow: auto;
  padding: 22px 17px 13px;
  background: radial-gradient(ellipse at 90% 0%, #f0e8df65, transparent 45%), var(--chat-paper);
  scrollbar-color: #d4c8ba transparent;
  scrollbar-width: thin;
}

.doris-chat-bubble {
  max-width: 84%;
  padding: 12px 14px;
  border: 1px solid #eee7df;
  border-radius: 15px 15px 15px 5px;
  background: #fff;
  box-shadow: 0 3px 10px #241b1608;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.doris-chat-bubble.visitor {
  align-self: flex-end;
  border-color: transparent;
  border-radius: 15px 15px 5px 15px;
  background: var(--chat-color);
  color: #fff;
}

.doris-chat-bubble.bot,
.doris-chat-bubble.agent { align-self: flex-start; }

.doris-chat-time {
  display: block;
  margin-top: 5px;
  color: #8b7f72;
  font-size: 9px;
}

.doris-chat-bubble.visitor .doris-chat-time { color: #ffffffa8; }

.doris-chat-questions {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 10px 15px 13px;
  border-top: 1px solid #eee7df;
  background: #fff;
  scrollbar-width: thin;
}

.doris-chat-question {
  flex: 0 0 auto;
  max-width: 250px;
  border: 1px solid #e8ded3;
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: #594b3e;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.doris-chat-question:hover { border-color: var(--chat-color); background: #f8f4ef; color: var(--chat-color); }

.doris-chat-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 12px 14px 13px;
  border-top: 1px solid var(--chat-line);
  background: #fff;
}

.doris-chat-optional { display: block; min-width: 0; }

.doris-chat-optional input,
.doris-chat-compose input {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  border: 1px solid #e9e1d8;
  border-radius: 9px;
  padding: 10px 11px;
  background: #fff;
  color: var(--chat-ink);
  font: inherit;
  font-size: 11px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.doris-chat-optional input:focus,
.doris-chat-compose input:focus { border-color: #9e8872; box-shadow: 0 0 0 3px #9e887214; }

.doris-chat-compose { display: flex; grid-column: 1 / -1; gap: 8px; }

.doris-chat-compose input { min-height: 45px; border-radius: 11px; background: #fcfaf7; font-size: 12px; }

.doris-chat-compose button {
  display: grid;
  flex: 0 0 45px;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: var(--chat-color);
  color: #fff;
  font-size: 19px;
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease;
}

.doris-chat-compose button:hover { transform: translateY(-1px); }
.doris-chat-form[aria-busy="true"] button { opacity: .55; pointer-events: none; }
.doris-chat-error { grid-column: 1 / -1; min-height: 0; margin: 0; color: #a13a32; font-size: 10px; }
.doris-chat-error:empty { display: none; }

@keyframes doris-chat-enter {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
  .doris-chat { right: 14px; bottom: 14px; }
  .doris-chat-panel {
    position: fixed;
    right: 8px;
    bottom: 78px;
    width: calc(100vw - 16px);
    height: min(650px, calc(100dvh - 100px));
    min-height: 390px;
    border-radius: 18px;
  }
  .doris-chat-launcher { min-height: 51px; padding-right: 16px; font-size: 11px; }
  .doris-chat-icon { width: 37px; height: 37px; }
  .doris-chat-panel > header { min-height: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  .doris-chat *, .doris-chat *::before, .doris-chat *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Compact header, required contact details, and stacked quick questions. */
.doris-chat-panel > header{padding-left:21px;flex-shrink:0}
.doris-chat-panel > header::before{content:none;display:none}
.doris-chat-panel{height:min(610px,calc(100dvh - 120px));min-height:min(420px,calc(100dvh - 120px))}
.doris-chat-log{min-height:0}
.doris-chat-questions{flex:0 0 auto;flex-direction:column;align-items:center;gap:8px;max-height:150px;overflow-x:hidden;overflow-y:auto;padding:12px 15px}
.doris-chat-questions:empty{display:none}
.doris-chat-question{max-width:100%;padding:8px 14px;border:1px solid #8974ff;border-radius:9px;background:#fff;color:#7760ed;font-size:11px;line-height:1.5;white-space:normal;text-align:center}
.doris-chat-question:hover{border-color:#7760ed;background:#f5f2ff;color:#624bd4}
.doris-chat-form{flex-shrink:0}
.doris-chat-identity{display:grid;gap:5px;min-width:0;color:#7f6e5d;font-size:10px;line-height:1.5}
.doris-chat-identity input{box-sizing:border-box;width:100%;min-width:0;min-height:40px;border:1px solid #e9e1d8;border-radius:9px;padding:10px 11px;background:#fff;color:var(--chat-ink);font:inherit;font-size:11px;outline:none}
.doris-chat-identity input:focus{border-color:#9e8872;box-shadow:0 0 0 3px #9e887214}
.doris-chat .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.doris-chat-email-note{grid-column:1/-1;font-size:9px;line-height:1.5;color:#998674;margin:0}
@media(max-width:600px){.doris-chat-panel{height:min(650px,calc(100dvh - 100px));min-height:min(390px,calc(100dvh - 100px))}.doris-chat-identity input,.doris-chat-compose input{font-size:16px}.doris-chat-questions{max-height:125px}}
@media(max-height:600px){.doris-chat-panel>header{min-height:65px;padding-top:10px;padding-bottom:10px}.doris-chat-questions{max-height:90px}.doris-chat-form{padding-top:8px;padding-bottom:8px}.doris-chat-log{padding-top:12px;padding-bottom:10px}}
