.ds-chat,
.ds-chat * { box-sizing: border-box; }
.ds-chat { --ds-chat-color: #2563eb; position: fixed; z-index: 999999; bottom: max(20px, env(safe-area-inset-bottom)); font-family: Arial, Helvetica, sans-serif; color: #172033; direction: ltr; }
.ds-chat--left { left: 20px; }
.ds-chat--right { right: 20px; }
.ds-chat__launcher { position: relative; display: grid; place-items: center; width: 58px; height: 58px; margin-top: 12px; margin-inline-start: 0; margin-inline-end: auto; border: 0; border-radius: 50%; color: #fff; background: var(--ds-chat-color); box-shadow: 0 10px 30px rgba(15, 23, 42, .25); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.ds-chat--right .ds-chat__launcher { margin-inline-start: auto; margin-inline-end: 0; }
.ds-chat__launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(15, 23, 42, .3); }
.ds-chat__launcher:focus-visible, .ds-chat button:focus-visible, .ds-chat input:focus-visible, .ds-chat textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--ds-chat-color), white 55%); outline-offset: 2px; }
.ds-chat__launcher svg { width: 27px; fill: currentColor; }
.ds-chat__badge { position: absolute; top: -5px; right: -5px; min-width: 22px; height: 22px; padding: 0 5px; border: 2px solid #fff; border-radius: 999px; color: #fff; background: #dc2626; font-size: 11px; line-height: 18px; font-weight: 700; }
.ds-chat__panel { width: min(370px, calc(100vw - 28px)); height: min(570px, calc(100vh - 110px)); border: 1px solid #e5e7eb; border-radius: 18px; background: #fff; box-shadow: 0 20px 55px rgba(15, 23, 42, .22); overflow: hidden; }
.ds-chat__panel[hidden] { display: none !important; }
.ds-chat__header { display: flex; align-items: center; justify-content: space-between; min-height: 70px; padding: 14px 17px; color: #fff; background: var(--ds-chat-color); }
.ds-chat__header strong { display: block; margin-bottom: 3px; font-size: 16px; }
.ds-chat__online { display: block; font-size: 11px; opacity: .88; }
.ds-chat__close { width: 34px; height: 34px; border: 0; border-radius: 50%; color: inherit; background: rgba(255,255,255,.14); font: 26px/1 Arial, sans-serif; cursor: pointer; }
.ds-chat__welcome { padding: 10px 15px; color: #475569; background: #f8fafc; border-bottom: 1px solid #eef2f7; font-size: 12px; line-height: 1.8; }
.ds-chat__messages { height: calc(100% - 252px); min-height: 170px; padding: 14px; overflow-y: auto; background: #f8fafc; scroll-behavior: smooth; }
.ds-chat__empty { margin: 38px 0; color: #94a3b8; text-align: center; font-size: 12px; }
.ds-chat__message { width: fit-content; max-width: 84%; margin: 0 0 10px; padding: 9px 11px; border-radius: 14px 14px 14px 4px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.ds-chat__message.is-visitor { margin-left: auto; border-radius: 14px 14px 4px 14px; color: #fff; background: var(--ds-chat-color); }
.ds-chat__message strong { display: block; margin-bottom: 4px; font-size: 10px; opacity: .75; }
.ds-chat__message p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.75; }
.ds-chat__message time { display: block; margin-top: 5px; font-size: 9px; opacity: .65; direction: ltr; text-align: left; }
.ds-chat__notice { padding: 6px 13px; font-size: 11px; line-height: 1.5; }
.ds-chat__notice.is-error { color: #991b1b; background: #fee2e2; }
.ds-chat__notice.is-success { color: #166534; background: #dcfce7; }
.ds-chat__form { padding: 10px 12px 12px; background: #fff; border-top: 1px solid #e5e7eb; }
.ds-chat__email-label span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ds-chat__email { width: 100%; height: 35px; margin: 0 0 7px; padding: 6px 9px; border: 1px solid #dbe1ea; border-radius: 9px; background: #fff; font: inherit; font-size: 12px; direction: ltr; }
.ds-chat__email-label.has-email .ds-chat__email { display: none; }
.ds-chat__compose { display: flex; align-items: flex-end; gap: 7px; }
.ds-chat__compose textarea { flex: 1; min-height: 44px; max-height: 92px; padding: 8px 10px; resize: vertical; border: 1px solid #dbe1ea; border-radius: 10px; font: inherit; font-size: 13px; line-height: 1.6; }
.ds-chat__compose button { flex: none; min-width: 64px; height: 42px; padding: 0 12px; border: 0; border-radius: 10px; color: #fff; background: var(--ds-chat-color); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.ds-chat__compose button:disabled { opacity: .6; cursor: wait; }
.ds-chat__hp { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
@media (max-width: 480px) {
  .ds-chat { bottom: max(12px, env(safe-area-inset-bottom)); }
  .ds-chat--left { left: 12px; }
  .ds-chat--right { right: 12px; }
  .ds-chat__panel { width: calc(100vw - 24px); height: min(620px, calc(100vh - 88px)); border-radius: 15px; }
  .ds-chat__launcher { width: 54px; height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  .ds-chat__launcher, .ds-chat__messages { transition: none; scroll-behavior: auto; }
}
