.bmt-live-widget {
  --live-ink: #17191d;
  --live-muted: #555e69;
  --live-gold: #d3a437;
  --live-border: #d8dde2;
  --live-margin: clamp(14px, 2.5vw, 32px);
  --live-bottom: var(--live-margin);
  --live-toolbar: 0px;
  position: fixed;
  right: clamp(14px, 2.5vw, 32px);
  bottom: var(--live-bottom);
  display: grid;
  justify-items: end;
  z-index: 9999;
  color: var(--live-ink);
  font-family: inherit;
}
.bmt-live-widget--with-ai { --live-bottom: calc(var(--live-margin) + 62px); }
body.admin-bar .bmt-live-widget { --live-toolbar: 32px; }
.bmt-live-widget[dir="rtl"] { left: clamp(14px, 2.5vw, 32px); right: auto; justify-items: start; }
.bmt-live-widget *, .bmt-live-widget *::before, .bmt-live-widget *::after { box-sizing: border-box; }
.bmt-live-widget [hidden] { display: none !important; }
.bmt-live-widget.is-other-chat-open, .bmt-ai-widget--human-open { visibility: hidden; pointer-events: none; }
.bmt-live-widget button, .bmt-live-widget input, .bmt-live-widget textarea { font: inherit; }
.bmt-live-widget button { cursor: pointer; }
.bmt-live-widget button:disabled { cursor: not-allowed; opacity: .6; }
.bmt-live-widget :is(button,input,textarea,a,[tabindex]):focus-visible { outline: 3px solid #a97819; outline-offset: 2px; }
.bmt-live-toggle { display: inline-flex; align-items: center; gap: 9px; min-height: 50px; max-width: calc(100vw - 28px); border: 1px solid var(--live-ink); border-radius: 30px; padding: 10px 18px; background: var(--live-gold); color: #121416; font-weight: 750; line-height: 1.3; box-shadow: 0 8px 22px #0002; }
.bmt-live-toggle__icon { font-size: 23px; line-height: 1; }
.bmt-live-badge { min-width: 22px; padding: 2px 5px; border-radius: 20px; background: #a3202b; color: #fff; font-size: 12px; text-align: center; }
.bmt-live-panel { display: grid; grid-template-rows: auto auto auto minmax(40px,1fr) auto auto; width: min(420px,calc(100vw - 28px)); max-height: min(750px,calc(100dvh - var(--live-bottom) - var(--live-toolbar) - 80px)); margin-bottom: 10px; overflow-y: auto; border: 1px solid var(--live-border); border-radius: 16px; background: #fff; box-shadow: 0 18px 60px #0004; }
.bmt-live-panel__header { grid-row: 1; }
.bmt-live-presence { grid-row: 2; }
.bmt-live-context { grid-row: 3; }
.bmt-live-messages { grid-row: 4; }
.bmt-live-status { grid-row: 5; }
.bmt-live-form { grid-row: 6; }
.bmt-live-panel__header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px; background: var(--live-ink); color: #fff; }
.bmt-live-panel__header strong { color: inherit; display: block; font-size: 17px; line-height: 1.35; }
.bmt-live-panel__header small { color: #d9dfe5; display: block; margin-top: 5px; font-size: 12px; line-height: 1.4; }
.bmt-live-close { flex: 0 0 32px; height: 32px; border: 1px solid #78818c; border-radius: 50%; background: transparent; color: #fff; padding: 0; font-size: 24px !important; line-height: 1; }
.bmt-live-presence { padding: 9px 16px; background: #f2f4f5; color: #505864; font-size: 12px; line-height: 1.5; border-bottom: 1px solid var(--live-border); }
.bmt-live-presence.is-online { background: #edf7f1; color: #1c5938; }
.bmt-live-context { padding: 7px 16px; font-size: 11px; line-height: 1.4; color: var(--live-muted); border-bottom: 1px solid var(--live-border); overflow-wrap: anywhere; }
.bmt-live-messages { display: flex; flex-direction: column; gap: 12px; min-height: 40px; padding: 16px; overflow-y: auto; overscroll-behavior: contain; background: #fff; }
.bmt-live-message { flex-shrink: 0; max-width: 92%; padding: 10px 13px; border-radius: 12px; background: #f2f4f5; color: var(--live-ink); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.bmt-live-message--visitor { align-self: flex-end; background: #fff4d9; border-end-end-radius: 3px; }
.bmt-live-message--staff { align-self: flex-start; border-end-start-radius: 3px; }
.bmt-live-message small { color: #626871; font-size: 10px; }
.bmt-live-message p { margin: 4px 0 0; color: inherit; white-space: pre-wrap; }
.bmt-live-status { padding: 0 16px; color: #794819; font-size: 12px; line-height: 1.45; }
.bmt-live-status:not(:empty) { padding-top: 7px; padding-bottom: 7px; background: #fff8e9; }
.bmt-live-form { display: grid; gap: 9px; padding: 12px 16px; border-top: 1px solid var(--live-border); margin: 0; }
.bmt-live-identity { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bmt-live-identity label { min-width: 0; }
.bmt-live-identity input, .bmt-live-form textarea { display: block; width: 100%; margin: 0; padding: 9px 10px; border: 1px solid #b8c1cb; border-radius: 6px; background: #fff; color: var(--live-ink); font-size: 13px; line-height: 1.5; }
.bmt-live-message-label { min-width: 0; }
.bmt-live-form textarea { min-height: 68px; max-height: 140px; resize: vertical; }
.bmt-live-consent { display: flex; align-items: flex-start; gap: 7px; color: var(--live-muted); font-size: 11px; line-height: 1.45; }
.bmt-live-consent input { flex: 0 0 16px; width: 16px; height: 16px; margin: 1px 0 0; accent-color: #926611; }
.bmt-live-consent a { color: #714d0a; text-decoration: underline; }
.bmt-live-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.bmt-live-submit { border: 1px solid var(--live-ink); background: var(--live-ink); color: #fff; min-height: 40px; padding: 8px 22px; border-radius: 6px; font-weight: 750; }
.bmt-live-new { border: 1px solid #b8c1cb; background: #fff; color: var(--live-ink); min-height: 40px; padding: 8px 10px; border-radius: 6px; font-size: 12px !important; }
.bmt-live-storage { color: #666d74; font-size: 10px; line-height: 1.45; }
.bmt-live-honeypot, .bmt-live-widget .screen-reader-text { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
@media (max-width: 520px) {
  .bmt-live-widget { right: 10px; bottom: 10px; }
  .bmt-live-widget[dir="rtl"] { left: 10px; right: auto; }
  .bmt-live-widget--with-ai { bottom: 72px; }
  .bmt-live-toggle { min-height: 44px; padding: 8px 13px; font-size: 13px; }
  .bmt-live-widget.is-open, .bmt-live-widget.is-open[dir="rtl"] { left: 10px; right: 10px; bottom: max(10px,env(safe-area-inset-bottom)); justify-items: stretch; }
  .bmt-live-widget.is-open .bmt-live-toggle { display: none; }
  .bmt-live-panel { width: 100%; height: min(740px,calc(100dvh - 24px - var(--live-toolbar))); max-height: calc(100dvh - 24px - var(--live-toolbar)); margin: 0; }
  .bmt-live-form { padding: 10px 12px; }
  .bmt-live-identity input, .bmt-live-form textarea { font-size: 16px; }
}
@media (max-width: 782px) { body.admin-bar .bmt-live-widget { --live-toolbar: 46px; } }
@media (max-width: 520px) and (max-height: 600px) {
  .bmt-live-panel__header { padding: 10px 12px; }
  .bmt-live-panel__header small, .bmt-live-storage { display: none; }
  .bmt-live-form { gap: 6px; }
  .bmt-live-form textarea { min-height: 50px; max-height: 80px; }
}
@media (prefers-reduced-motion: reduce) { .bmt-live-widget * { scroll-behavior: auto !important; } }
