.support-chat {
  --sc-accent: var(--btn-primary-bg, #fe7200);
  --sc-accent-hover: var(--btn-primary-bg-hover, #c67c0c);
  --sc-text: var(--body-c, #222);
  --sc-muted: #69707a;
  --sc-border: rgba(0, 0, 0, .09);
  --sc-radius: var(--border-radius-1, 12px);
  --sc-shadow: 0 18px 55px rgba(28, 32, 38, .18), 0 3px 12px rgba(28, 32, 38, .1);
  --support-chat-launcher-right: 20px;
  --support-chat-launcher-bottom: 20px;
  position: fixed;
  z-index: 1034;
  right: var(--support-chat-launcher-right);
  bottom: var(--support-chat-launcher-bottom);
  font-family: var(--body-font, "Open Sans", Arial, sans-serif);
  font-size: 14px;
  line-height: 1.4;
  color: var(--sc-text);
  text-align: left;
}

.support-chat *, .support-chat *::before, .support-chat *::after { box-sizing: border-box; }
.support-chat [hidden] { display: none !important; }
.support-chat button, .support-chat textarea { font: inherit; }
.support-chat button { -webkit-tap-highlight-color: transparent; }

.support-chat__launcher {
  position: relative;
  display: flex;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0;
  color: #fff;
  background: linear-gradient(145deg, #ff8a2e, var(--sc-accent));
  border: 0;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(254, 114, 0, .3);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.support-chat__launcher:hover { transform: translateY(-2px); box-shadow: 0 13px 32px rgba(254, 114, 0, .36); }
.support-chat__launcher:active { transform: translateY(0); }
.support-chat__launcher-icon { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.support-chat__badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  line-height: 22px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #d94747;
  border: 2px solid #fff;
  border-radius: 12px;
}

.support-chat__panel {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  display: flex;
  overflow: hidden;
  width: 410px;
  height: 620px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--sc-border);
  border-radius: 20px;
  box-shadow: var(--sc-shadow);
  transform-origin: right bottom;
  animation: support-chat-open .18s ease-out;
}

.support-chat__header {
  display: flex;
  min-height: 76px;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  padding: 12px 12px 12px 16px;
  color: #fff;
  background: linear-gradient(125deg, #f77f20, var(--sc-accent));
}
.support-chat__identity { display: flex; width: 42px; height: 42px; flex: 0 0 42px; align-items: center; justify-content: center; background: rgba(255,255,255,.17); border-radius: 14px; }
.support-chat__identity svg { width: 25px; height: 25px; fill: currentColor; }
.support-chat__heading { min-width: 0; flex: 1 1 auto; }
.support-chat__heading h2 { margin: 0 0 2px; color: inherit; font-size: 17px; font-weight: 700; line-height: 1.2; }
.support-chat__heading p { overflow: hidden; margin: 0; color: rgba(255,255,255,.9); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.support-chat__header-button { display: flex; width: 36px; height: 36px; flex: 0 0 36px; align-items: center; justify-content: center; padding: 0; color: #fff; background: rgba(255,255,255,.12); border: 0; border-radius: 11px; cursor: pointer; }
.support-chat__header-button:hover { background: rgba(255,255,255,.23); }
.support-chat__header-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.support-chat__connection { flex: 0 0 auto; padding: 7px 14px; color: #725518; background: #fff5d9; border-bottom: 1px solid #f3e3ba; font-size: 12px; text-align: center; }
.support-chat__connection[data-kind="error"] { color: #8d3434; background: #fff0f0; border-color: #f2d2d2; }
.support-chat__connection[data-kind="ok"] { color: #37683c; background: #edf8ef; border-color: #d5ead8; }

.support-chat__content { position: relative; display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; overflow-y: auto; overflow-x: hidden; padding: 16px; background: linear-gradient(#fafafa, #f7f7f7); overscroll-behavior: contain; scrollbar-width: thin; }
.support-chat__loading { display: flex; min-height: 100%; align-items: center; justify-content: center; gap: 9px; color: var(--sc-muted); }
.support-chat__welcome, .support-chat__closed { max-width: 310px; margin: auto; padding: 24px 10px; text-align: center; }
.support-chat__welcome-icon, .support-chat__closed-icon { display: flex; width: 62px; height: 62px; align-items: center; justify-content: center; margin: 0 auto 15px; color: var(--sc-accent); background: rgba(254,114,0,.09); border-radius: 22px; }
.support-chat__welcome-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.support-chat__closed-icon { font-size: 28px; font-weight: 700; color: #4f8754; background: #edf7ee; }
.support-chat__welcome h3, .support-chat__closed h3 { margin: 0 0 8px; color: #30343a; font-size: 18px; font-weight: 700; }
.support-chat__welcome p, .support-chat__closed p { margin: 0; color: var(--sc-muted); font-size: 13px; line-height: 1.55; }
.support-chat__secondary-button { min-height: 40px; margin-top: 18px; padding: 0 17px; color: var(--sc-accent); background: #fff; border: 1px solid rgba(254,114,0,.35); border-radius: var(--sc-radius); cursor: pointer; }
.support-chat__secondary-button:hover { color: #fff; background: var(--sc-accent); }

.support-chat__older { align-self: center; margin: 0 0 13px; padding: 6px 11px; color: #656b73; background: #fff; border: 1px solid var(--sc-border); border-radius: 14px; font-size: 11px; cursor: pointer; }
.support-chat__messages { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.support-chat__message { position: relative; display: flex; max-width: 84%; flex-direction: column; align-self: flex-start; }
.support-chat__message--customer { align-self: flex-end; align-items: flex-end; }
.support-chat__bubble { min-width: 66px; padding: 9px 12px 6px; color: #34383e; background: #fff; border: 1px solid var(--sc-border); border-radius: 5px 15px 15px 15px; box-shadow: 0 2px 7px rgba(0,0,0,.04); overflow-wrap: anywhere; white-space: pre-wrap; }
.support-chat__message--customer .support-chat__bubble { color: #fff; background: var(--sc-accent); border-color: transparent; border-radius: 15px 5px 15px 15px; }
.support-chat__message--deleted .support-chat__bubble { color: #777; background: #f0f0f0; border-color: transparent; font-style: italic; }
.support-chat__meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 4px; font-size: 9.5px; color: rgba(255,255,255,.78); }
.support-chat__message--operator .support-chat__meta, .support-chat__message--deleted .support-chat__meta { color: #92979e; }
.support-chat__message-menu { position: absolute; top: -7px; right: calc(100% + 3px); }
.support-chat__message-menu-button { display: flex; width: 28px; height: 28px; align-items: center; justify-content: center; padding: 0; color: #7b8086; background: transparent; border: 0; border-radius: 8px; opacity: 0; cursor: pointer; }
.support-chat__message:hover .support-chat__message-menu-button, .support-chat__message-menu-button:focus { opacity: 1; }
.support-chat__message-actions { position: absolute; z-index: 4; top: 28px; right: 0; min-width: 132px; padding: 5px; background: #fff; border: 1px solid var(--sc-border); border-radius: 10px; box-shadow: 0 8px 25px rgba(0,0,0,.14); }
.support-chat__message-actions button { display: block; width: 100%; padding: 8px 10px; color: #41464d; background: transparent; border: 0; border-radius: 7px; text-align: left; cursor: pointer; }
.support-chat__message-actions button:hover { background: #f2f2f2; }
.support-chat__message-actions .support-chat__message-action--delete { color: #b64040; }
.support-chat__retry { margin-top: 4px; padding: 2px 0; color: #9b3e3e; background: transparent; border: 0; font-size: 10px; text-decoration: underline; cursor: pointer; }
.support-chat__message--pending { opacity: .72; }
.support-chat__reply-preview { display: block; overflow: hidden; width: 100%; margin: 0 0 7px; padding: 5px 7px; color: inherit; background: rgba(0,0,0,.045); border: 0; border-left: 3px solid var(--sc-accent); border-radius: 4px; font-size: 10.5px; text-align: left; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; opacity: .9; }
.support-chat__message--customer .support-chat__reply-preview { background: rgba(255,255,255,.14); border-left-color: rgba(255,255,255,.85); }
.support-chat__caption { display: block; margin-top: 7px; }
.support-chat__reply-bar { background: #f7f8fb; border-top-color: #e2e5eb; }
.support-chat__reply-bar strong { color: #566272; }

.support-chat__new-message { position: sticky; bottom: 4px; align-self: center; margin-top: 8px; padding: 6px 12px; color: #fff; background: #5f6670; border: 0; border-radius: 15px; font-size: 11px; box-shadow: 0 3px 10px rgba(0,0,0,.15); cursor: pointer; }
.support-chat__edit-bar { display: flex; min-height: 52px; flex: 0 0 auto; align-items: center; gap: 10px; padding: 8px 12px; background: #fff8f1; border-top: 1px solid #f3dfca; }
.support-chat__edit-bar > div { min-width: 0; flex: 1 1 auto; }
.support-chat__edit-bar strong, .support-chat__edit-bar span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.support-chat__edit-bar strong { color: var(--sc-accent); font-size: 11px; }
.support-chat__edit-bar span { color: #6b7077; font-size: 11px; }
.support-chat__edit-bar button { width: 32px; height: 32px; padding: 0; color: #777; background: transparent; border: 0; font-size: 22px; cursor: pointer; }

.support-chat__composer { position: relative; display: flex; min-height: 72px; flex: 0 0 auto; align-items: flex-end; gap: 9px; padding: 11px 12px; background: #fff; border-top: 1px solid var(--sc-border); }
.support-chat__composer textarea { width: 100%; min-height: 42px; max-height: 116px; flex: 1 1 auto; resize: none; overflow-y: auto; padding: 10px 11px; color: var(--sc-text); background: #f6f6f6; border: 1px solid transparent; border-radius: 13px; outline: none; line-height: 20px; }
.support-chat__composer textarea:focus { background: #fff; border-color: rgba(254,114,0,.55); box-shadow: 0 0 0 3px rgba(254,114,0,.1); }
.support-chat__counter { position: absolute; right: 68px; bottom: 3px; color: #8b9096; font-size: 9px; }
.support-chat__send { display: flex; width: 43px; height: 43px; flex: 0 0 43px; align-items: center; justify-content: center; padding: 0; color: #fff; background: var(--sc-accent); border: 0; border-radius: 13px; cursor: pointer; }
.support-chat__send:hover:not(:disabled) { background: var(--sc-accent-hover); }
.support-chat__send:disabled { color: #999; background: #e7e7e7; cursor: default; }
.support-chat__send svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.support-chat__send .support-chat__spinner { display: none; }
.support-chat__send.is-loading svg { display: none; }
.support-chat__send.is-loading .support-chat__spinner { display: block; }
.support-chat__error { flex: 0 0 auto; padding: 8px 13px; color: #983d3d; background: #fff0f0; border-top: 1px solid #f3d1d1; font-size: 11.5px; }
.support-chat__spinner { display: inline-block; width: 17px; height: 17px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: support-chat-spin .65s linear infinite; }
.support-chat__sr-only { 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; }

.support-chat button:focus-visible, .support-chat textarea:focus-visible { outline: 3px solid rgba(0, 92, 180, .42); outline-offset: 2px; }

.support-chat__header-menu { position: relative; flex: 0 0 auto; }
.support-chat__header-menu .support-chat__header-button span { margin-top: -7px; font-size: 25px; line-height: 1; }
.support-chat__header-actions { position: absolute; z-index: 8; top: 42px; right: 0; min-width: 178px; padding: 6px; color: #333; background: #fff; border: 1px solid var(--sc-border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.support-chat__header-actions button { display: block; width: 100%; padding: 9px 11px; color: #353a40; background: transparent; border: 0; border-radius: 8px; text-align: left; cursor: pointer; }
.support-chat__header-actions button:hover { background: #f3f3f3; }
.support-chat__header-actions button:first-child { color: #b43a3a; }

.support-chat__attachment { display: block; min-width: 210px; max-width: 100%; }
.support-chat__attachment-image { display: block; overflow: hidden; width: 100%; padding: 0; background: #eee; border: 0; border-radius: 11px; cursor: zoom-in; }
.support-chat__attachment-image img { display: block; width: 100%; max-width: 280px; max-height: 260px; object-fit: cover; }
.support-chat__attachment video { display: block; width: 280px; max-width: 100%; max-height: 250px; background: #111; border-radius: 10px; }
.support-chat__document { display: flex; min-width: 220px; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.support-chat__document:hover { color: inherit; text-decoration: none; }
.support-chat__document-icon { display: flex; width: 38px; height: 42px; flex: 0 0 38px; align-items: center; justify-content: center; color: var(--sc-accent); background: #fff2e8; border-radius: 9px; font-size: 11px; font-weight: 800; }
.support-chat__document-info { min-width: 0; flex: 1 1 auto; }
.support-chat__document-name { display: block; overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.support-chat__document-meta { display: block; margin-top: 3px; color: inherit; opacity: .72; font-size: 10px; }
.support-chat__message--customer .support-chat__attachment-image,
.support-chat__message--customer .support-chat__attachment video { outline: 1px solid rgba(255,255,255,.24); }
.support-chat__message--customer .support-chat__document-icon { color: #fff; background: rgba(255,255,255,.18); }

.support-chat__file-preview { display: flex; min-height: 78px; flex: 0 0 auto; align-items: center; gap: 9px; padding: 9px 11px; background: #fff8f1; border-top: 1px solid #f2ddca; }
.support-chat__file-thumb { display: flex; overflow: hidden; width: 52px; height: 52px; flex: 0 0 52px; align-items: center; justify-content: center; color: var(--sc-accent); background: #fff; border: 1px solid var(--sc-border); border-radius: 11px; font-size: 11px; font-weight: 800; }
.support-chat__file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.support-chat__file-details { min-width: 0; flex: 1 1 auto; }
.support-chat__file-details strong, .support-chat__file-details > span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.support-chat__file-details strong { font-size: 12px; }
.support-chat__file-details > span { margin-top: 2px; color: #777; font-size: 10px; }
.support-chat__progress { overflow: hidden; height: 5px; margin-top: 6px; background: #eadfd7; border-radius: 4px; }
.support-chat__progress span { display: block; width: 0; height: 100%; background: var(--sc-accent); transition: width .12s linear; }
.support-chat__file-cancel { width: 34px; height: 34px; flex: 0 0 34px; padding: 0; color: #777; background: transparent; border: 0; font-size: 22px; cursor: pointer; }
.support-chat__file-send { min-height: 38px; padding: 0 12px; color: #fff; background: var(--sc-accent); border: 0; border-radius: 10px; cursor: pointer; }
.support-chat__file-send:disabled { background: #bbb; cursor: default; }

.support-chat__attach { display: flex; width: 44px; height: 44px; flex: 0 0 44px; align-items: center; justify-content: center; padding: 0; color: #70757c; background: #f4f4f4; border: 0; border-radius: 13px; cursor: pointer; }
.support-chat__attach:hover { color: var(--sc-accent); background: #fff2e8; }
.support-chat__attach:disabled { opacity: .5; cursor: default; }
.support-chat__attach svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.support-chat__overlay, .support-chat__lightbox { position: fixed; z-index: 1042; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(18,21,25,.56); }
.support-chat__confirm { width: min(390px, 100%); padding: 24px; color: #30343a; background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.support-chat__confirm h3 { margin: 0 0 9px; font-size: 19px; }
.support-chat__confirm p { margin: 0 0 21px; color: #686e76; line-height: 1.55; }
.support-chat__confirm > div { display: flex; justify-content: flex-end; gap: 9px; }
.support-chat__confirm .support-chat__secondary-button { margin-top: 0; }
.support-chat__danger-button { min-height: 40px; padding: 0 16px; color: #fff; background: #c63f3f; border: 0; border-radius: 11px; cursor: pointer; }
.support-chat__danger-button:hover { background: #a92f2f; }

.support-chat__lightbox { z-index: 1043; background: rgba(10,12,15,.88); }
.support-chat__lightbox img { display: block; max-width: min(1100px, 94vw); max-height: 90vh; object-fit: contain; }
.support-chat__lightbox button { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 18px; width: 46px; height: 46px; color: #fff; background: rgba(255,255,255,.14); border: 0; border-radius: 14px; font-size: 30px; cursor: pointer; }

@keyframes support-chat-open { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes support-chat-spin { to { transform: rotate(360deg); } }

@media (max-width: 767px) {
  .support-chat {
    --support-chat-launcher-right: 12px;
    --support-chat-launcher-bottom: 82px;
    bottom: calc(var(--support-chat-launcher-bottom) + env(safe-area-inset-bottom, 0px));
  }
  .support-chat__launcher { width: 50px; height: 50px; border-radius: 16px; }
  .support-chat__panel { position: fixed; z-index: 1035; inset: 0; width: auto; min-width: 0; max-width: none; height: 100vh; height: 100dvh; max-height: none; border: 0; border-radius: 0; transform-origin: center bottom; }
  .support-chat__header { min-height: calc(70px + env(safe-area-inset-top, 0px)); padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .support-chat__content { padding: 14px 12px; }
  .support-chat__composer { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .support-chat__composer textarea { font-size: 16px; }
  .support-chat__message { max-width: 88%; }
  .support-chat__message-menu-button { opacity: 1; }
  body.support-chat-open { overflow: hidden !important; overscroll-behavior: none; }
}

@media (max-width: 374px) {
  .support-chat { --support-chat-launcher-right: 10px; }
  .support-chat__heading p { max-width: 185px; }
  .support-chat__header { gap: 7px; padding-left: 10px; padding-right: 8px; }
  .support-chat__identity { width: 38px; height: 38px; flex-basis: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .support-chat *, .support-chat *::before, .support-chat *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
