.dm-chat {
  --dm-ink: #192f28;
  --dm-cream: #f5f0df;
  --dm-gold: #c7a65a;
  position: fixed;
  z-index: 35;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  font-family: Manrope, system-ui, sans-serif;
  color: var(--dm-ink);
}
.dm-chat *, .dm-chat *::before, .dm-chat *::after { box-sizing: border-box; }
.dm-chat button, .dm-chat textarea { font: inherit; }
.dm-chat button { cursor: pointer; }
.dm-chat button:focus-visible, .dm-chat textarea:focus-visible, .dm-chat a:focus-visible { outline: 3px solid var(--dm-gold); outline-offset: 3px; }
.dm-chat button:disabled { cursor: wait; opacity: .6; }
.dm-chat__launcher {
  display: flex; align-items: center; gap: 9px; min-height: 50px;
  margin-left: auto; padding: 10px 18px; border: 1px solid var(--dm-gold);
  border-radius: 999px; background: #17362e; color: #f8f2df;
  box-shadow: 0 8px 28px #07140d4d; font-weight: 700;
}
.dm-chat__launcher-icon { color: #e2c471; font-size: 22px; line-height: 1; }
.dm-chat__launcher--open { display: none; }
.dm-chat__panel {
  width: min(350px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  height: min(680px, calc(100dvh - 110px));
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid #c7a65a; border-radius: 20px;
  background: var(--dm-cream); box-shadow: 0 16px 55px #07140d75;
}
.dm-chat__panel[hidden] { display: none; }
.dm-chat__header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: #17362e; color: #f8f2df; }
.dm-chat__header div { display: grid; gap: 2px; }
.dm-chat__header strong { font-size: 16px; }
.dm-chat__header span { font-size: 12px; color: #d6c798; }
.dm-chat__close { width: 38px; height: 38px; border: 1px solid #b7ae8e; border-radius: 50%; background: transparent; color: #fff; font-size: 26px !important; line-height: 1; }
.dm-chat__messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; overscroll-behavior: contain; }
.dm-chat__message { max-width: 91%; width: fit-content; margin: 0; padding: 11px 13px; border-radius: 15px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.dm-chat__message--agent { background: #e4ddc7; border-bottom-left-radius: 4px; }
.dm-chat__message--user { align-self: flex-end; background: #205244; color: #fff; border-bottom-right-radius: 4px; }
.dm-chat__typing { color: #5b6b60; font-style: italic; }
@media (prefers-reduced-motion: no-preference) { .dm-chat__typing::after { content: '…'; animation: dm-typing 1s steps(3) infinite; } }
@keyframes dm-typing { 0% { opacity: .2; } 100% { opacity: 1; } }
.dm-chat__form { flex: 0 0 auto; border-top: 1px solid #d3cbb2; padding: 12px 14px 0; }
.dm-chat__form label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; }
.dm-chat__compose { display: flex; gap: 8px; align-items: end; }
.dm-chat__compose textarea { display: block; flex: 1 1 0; min-width: 0; width: auto; min-height: 48px; max-height: 100px; resize: vertical; border: 1px solid #aaa88e; border-radius: 12px; padding: 9px 10px; background: #fffdf8; color: var(--dm-ink); font-size: 16px; line-height: 1.35; }
.dm-chat__send { flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 12px; background: #205244; color: #fff; font-size: 19px !important; }
.dm-chat__status { min-height: 17px; margin: 5px 0 0; color: #57665a; font-size: 11px; }
.dm-chat__note { flex: 0 0 auto; margin: 0; padding: 0 14px 11px; color: #57665a; font-size: 11px; line-height: 1.4; }
.dm-chat__note a { color: #205244; text-decoration: underline; text-underline-offset: 2px; }
.dm-chat__forget { border: 0; background: transparent; color: #205244; text-decoration: underline; text-underline-offset: 2px; padding: 0; font-size: inherit; }
@media (max-width: 600px) {
  .dm-chat { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .dm-chat__panel { height: min(680px, calc(100dvh - 110px)); }
}
@media (prefers-reduced-motion: no-preference) {
  .dm-chat__launcher, .dm-chat__send { transition: background-color .15s ease, transform .15s ease; }
  .dm-chat__launcher:hover, .dm-chat__send:hover { background: #2b644f; }
}
