.support-widget {
  --chat-bg: #0b1422;
  --chat-panel: #0f1a2b;
  --chat-line: rgba(163, 183, 204, .16);
  --chat-muted: #8392a5;
  position: fixed;
  z-index: 150;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  font-family: "Onest", system-ui, sans-serif;
}

.support-widget-launcher {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  color: #06120f;
  background: #39dcb1;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .38);
  cursor: grab;
  touch-action: none;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.support-widget-launcher:hover {
  background: #55e8c1;
  box-shadow: 0 15px 38px rgba(0, 0, 0, .44);
  transform: translateY(-2px);
}

.support-widget-launcher:active { cursor: grabbing; transform: scale(.97); }
.support-widget-launcher:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.support-widget-launcher svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.support-widget-launcher-pulse { position: absolute; top: 1px; right: 2px; width: 11px; height: 11px; border: 2px solid #08111d; border-radius: 50%; background: #fff; }

.support-widget-panel {
  position: fixed;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  width: min(344px, calc(100vw - 28px));
  max-height: min(610px, calc(100dvh - 28px));
  border: 1px solid var(--chat-line);
  border-radius: 22px;
  color: #edf4f4;
  background: var(--chat-bg);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .52);
  transform-origin: bottom right;
  animation: support-widget-in .2s ease-out;
}

.support-widget-panel[hidden] { display: none; }

@keyframes support-widget-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.support-widget-header {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--chat-line);
  background: #0d1828;
}

.support-widget-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #07130f; background: #39dcb1; }
.support-widget-avatar svg { width: 19px; fill: none; stroke: currentColor; stroke-linejoin: round; stroke-width: 1.8; }
.support-widget-header strong { display: block; font-size: 14px; font-weight: 600; }
.support-widget-header span { display: flex; gap: 6px; align-items: center; margin-top: 2px; color: #91a0b1; font-size: 10px; }
.support-widget-header span i { width: 6px; height: 6px; border-radius: 50%; background: #39dcb1; box-shadow: 0 0 0 3px rgba(57, 220, 177, .1); }
.support-widget-header-actions { display: flex; gap: 2px; align-items: center; }
.support-widget-header-actions button { position: relative; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; color: #91a0b1; background: transparent; font: inherit; font-size: 23px; line-height: 1; cursor: pointer; }
.support-widget-header-actions button:hover,
.support-widget-header-actions button[aria-pressed="true"] { color: #fff; background: rgba(255, 255, 255, .06); }
.support-widget-header-actions button:first-child svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.support-widget[data-has-history="true"] .support-widget-header-actions button:first-child::after { position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; border: 2px solid #0d1828; border-radius: 50%; background: #39dcb1; content: ""; }

.support-widget-body { overflow-y: auto; padding: 14px; scrollbar-color: #344258 transparent; scrollbar-width: thin; }
.support-widget-intro { margin-bottom: 12px; }
.support-widget[data-waiting="true"] .support-widget-intro { display: none; }
.support-widget[data-view="history"] .support-widget-intro { display: none; }
.support-widget-intro strong { font-size: 17px; font-weight: 600; }
.support-widget-intro p { margin: 4px 0 0; color: var(--chat-muted); font-size: 11px; line-height: 1.45; }
.support-widget-form { display: grid; gap: 8px; }
.support-widget-form[hidden] { display: none; }
.support-widget-field { display: grid; gap: 6px; margin: 0; color: #aeb9c7; font-size: 11px; }
.support-widget-field > span { padding-left: 2px; }
.support-widget-field b { color: #ff6f78; font-weight: 500; }
.support-widget-field textarea,
.support-widget-control,
.support-widget-phone {
  border: 1px solid var(--chat-line);
  border-radius: 12px;
  background: #08111e;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.support-widget-field textarea {
  width: 100%;
  min-height: 62px;
  resize: vertical;
  padding: 10px 12px;
  color: #edf4f4;
  outline: none;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.support-widget-control { display: grid; grid-template-columns: 37px minmax(0, 1fr); align-items: center; }
.support-widget-control > i { color: #708096; text-align: center; font-size: 14px; font-style: normal; }
.support-widget-control input,
.support-widget-phone input {
  min-width: 0;
  height: 40px;
  border: 0;
  color: #edf4f4;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
}

.support-widget-control input { width: 100%; padding: 0 12px 0 0; }
.support-widget-phone { display: grid; grid-template-columns: 94px minmax(0, 1fr); }
.support-widget-phone > input { width: 100%; padding: 0 12px; }
.support-widget-prefix { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 28px; border-right: 1px solid var(--chat-line); }
.support-widget-prefix > input[type="text"] { width: 100%; padding: 0 2px 0 11px; font-weight: 600; }
.support-widget-prefix > button { display: grid; place-items: center; width: 28px; padding: 0; border: 0; color: #8c9aab; background: transparent; cursor: pointer; }
.support-widget-prefix > button span { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }
.support-widget-prefix > button[aria-expanded="true"] span { transform: translateY(2px) rotate(225deg); }
.support-widget-country-menu {
  position: absolute;
  z-index: 4;
  bottom: calc(100% + 7px);
  left: 0;
  overflow-y: auto;
  width: 228px;
  max-height: 218px;
  padding: 6px;
  border: 1px solid rgba(163, 183, 204, .2);
  border-radius: 12px;
  background: #111d2e;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .5);
  scrollbar-color: #3a4a61 transparent;
  scrollbar-width: thin;
}
.support-widget-country-menu[hidden] { display: none; }
.support-widget-country-menu button { display: grid; grid-template-columns: 25px 48px minmax(0, 1fr); gap: 5px; align-items: center; width: 100%; min-height: 34px; padding: 5px 8px; border: 0; border-radius: 8px; color: #dce5ea; background: transparent; text-align: left; cursor: pointer; }
.support-widget-country-menu button:hover,
.support-widget-country-menu button[aria-selected="true"] { background: rgba(57, 220, 177, .1); }
.support-widget-country-menu button b { color: #eef5f5; font-size: 12px; }
.support-widget-country-menu button small { overflow: hidden; color: #8f9dad; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.support-widget-field textarea:focus,
.support-widget-control:focus-within,
.support-widget-phone:focus-within { border-color: rgba(57, 220, 177, .75); box-shadow: 0 0 0 3px rgba(57, 220, 177, .08); }
.support-widget-field [aria-invalid="true"] { border-color: #f36f78; }
.support-widget-field > small { min-height: 0; color: #ff8189; font-size: 10px; }
.support-widget-field > small:empty { display: none; }
.support-widget-form-error { color: #ff8189; font-size: 11px; line-height: 1.4; }
.support-widget-form-error:empty { display: none; }
.support-widget-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.support-widget-history-view { display: flex; flex-direction: column; min-height: 365px; }
.support-widget-history-view[hidden] { display: none; }
.support-widget-history-view > header { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; align-items: center; margin-bottom: 14px; }
.support-widget-history-view > header button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--chat-line); border-radius: 50%; color: #9dabbc; background: #0d1827; cursor: pointer; }
.support-widget-history-view > header button:hover { color: #fff; border-color: rgba(57, 220, 177, .35); }
.support-widget-history-view > header svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.support-widget-history-view > header strong { display: block; color: #eef4f4; font-size: 15px; font-weight: 600; }
.support-widget-history-view > header span { display: block; margin-top: 2px; color: #718096; font-size: 9px; }
.support-widget-history-list { display: grid; gap: 7px; }
.support-widget-history-item { display: grid; gap: 6px; width: 100%; padding: 11px 12px; border: 1px solid rgba(163, 183, 204, .12); border-radius: 11px; color: inherit; background: #101b2b; text-align: left; cursor: pointer; }
.support-widget-history-item:hover { border-color: rgba(57, 220, 177, .26); background: #142235; }
.support-widget-history-item:disabled { cursor: default; opacity: .55; }
.support-widget-history-item span { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.support-widget-history-item b { color: #dce5ea; font-size: 10px; }
.support-widget-history-item time { color: #66758a; font-size: 8px; }
.support-widget-history-item small { overflow: hidden; color: #8997a8; font-size: 9px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.support-widget-history-empty { margin: auto 18px; color: #718096; font-size: 11px; line-height: 1.5; text-align: center; }
.support-widget-history-empty[hidden] { display: none; }
.support-widget-initial-files { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: -1px; }
.support-widget-initial-files label { display: inline-flex; gap: 6px; align-items: center; color: #80dac1; font-size: 10px; cursor: pointer; }
.support-widget-initial-files label:hover { color: #a5ecd8; }
.support-widget-initial-files svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.support-widget-initial-files input,
.support-widget-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.support-widget-initial-files > span { color: #627185; font-size: 8px; }
.support-widget-file-preview,
.support-widget-reply-preview { display: flex; overflow-x: auto; gap: 6px; scrollbar-width: thin; }
.support-widget-file-preview:empty,
.support-widget-reply-preview:empty { display: none; }
.support-widget-file-thumb { position: relative; flex: 0 0 50px; width: 50px; height: 42px; overflow: hidden; border: 1px solid var(--chat-line); border-radius: 8px; background: #07101c; }
.support-widget-file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.support-widget-file-thumb button { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: rgba(5, 9, 15, .78); font-size: 12px; line-height: 1; cursor: pointer; }
.support-widget-file-error { color: #ff8189; font-size: 10px; }
.support-widget-file-error:empty { display: none; }

.support-widget-submit {
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
  height: 44px;
  margin-top: 2px;
  border: 0;
  border-radius: 12px;
  color: #06120f;
  background: #39dcb1;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.support-widget-submit:hover { background: #55e8c1; }
.support-widget-submit:disabled { cursor: wait; opacity: .65; }
.support-widget-submit i { display: none; width: 15px; height: 15px; border: 2px solid rgba(6, 18, 15, .3); border-top-color: #06120f; border-radius: 50%; animation: support-widget-spin .7s linear infinite; }
.support-widget-submit.is-loading i { display: block; }
@keyframes support-widget-spin { to { transform: rotate(360deg); } }
.support-widget-privacy { margin: 0; color: #67758a; font-size: 8px; line-height: 1.4; text-align: center; }

.support-widget-waiting { display: flex; flex-direction: column; min-height: 365px; padding: 0; }
.support-widget-waiting[hidden] { display: none; }
.support-widget-conversation-tools { display: flex; justify-content: flex-end; margin: -3px 0 5px; }
.support-widget-conversation-tools button { padding: 5px 8px; border: 0; border-radius: 8px; color: #8291a5; background: transparent; font: inherit; font-size: 9px; cursor: pointer; }
.support-widget-conversation-tools button:hover { color: #79e6c8; background: rgba(57, 220, 177, .07); }
.support-widget-conversation-tools button:disabled { cursor: wait; opacity: .55; }
.support-widget-new-confirm { display: flex; gap: 4px; align-items: center; color: #9eabba; font-size: 9px; }
.support-widget-new-confirm[hidden] { display: none; }
.support-widget-new-confirm button:last-child { color: #07120f; background: #39dcb1; }
.support-widget-new-confirm button:last-child:hover { color: #07120f; background: #55e8c1; }
.support-widget-conversation { display: flex; overflow-y: auto; flex: 1 1 auto; flex-direction: column; gap: 10px; min-height: 230px; max-height: 330px; padding: 5px 1px 16px; scrollbar-color: #344258 transparent; scrollbar-width: thin; }
.support-widget-chat-date { margin: 0 0 16px; color: #68778a; font-size: 9px; text-align: center; }
.support-widget-message { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 9px; align-items: end; }
.support-widget-message-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #06120f; background: #39dcb1; font-size: 12px; font-weight: 700; }
.support-widget-message-bubble { min-width: 0; padding: 9px 10px; border: 1px solid rgba(163, 183, 204, .15); border-radius: 12px 12px 12px 3px; background: #111d2e; }
.support-widget-message span { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.support-widget-message span b { color: #eaf2f3; font-size: 11px; }
.support-widget-message time { color: #65758a; font-size: 8px; }
.support-widget-message p { margin: 5px 0 0; color: #aeb9c7; font-size: 11px; line-height: 1.5; }
.support-widget-message.is-user { display: block; padding-left: 44px; }
.support-widget-message.is-user .support-widget-message-avatar { display: none; }
.support-widget-message.is-user .support-widget-message-bubble { margin-left: auto; border-color: rgba(57, 220, 177, .2); border-radius: 12px 12px 3px 12px; background: rgba(57, 220, 177, .1); }
.support-widget-message.is-user span b { color: #87e8cd; }
.support-widget-message-attachments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 7px; }
.support-widget-message-attachments a { display: block; overflow: hidden; min-height: 58px; border-radius: 7px; background: #07101b; }
.support-widget-message-attachments img { display: block; width: 100%; height: 100%; max-height: 118px; object-fit: cover; }
.support-widget-waiting-status { display: flex; justify-content: center; gap: 8px; align-items: center; width: fit-content; margin: 0 auto 10px; padding: 7px 11px; border: 1px solid var(--chat-line); border-radius: 999px; color: #acb8c6; font-size: 9px; }
.support-widget-waiting-status i { width: 7px; height: 7px; border-radius: 50%; background: #f1b74d; box-shadow: 0 0 0 4px rgba(241, 183, 77, .08); }
.support-widget-composer { margin: 0 -14px -14px; padding: 9px 10px 10px; border-top: 1px solid var(--chat-line); background: #0d1726; }
.support-widget-reply-preview { margin-bottom: 7px; padding: 0 2px; }
.support-widget-compose-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 36px; gap: 5px; align-items: end; }
.support-widget-attach { display: grid; place-items: center; width: 34px; height: 36px; border-radius: 9px; color: #8594a7; cursor: pointer; }
.support-widget-attach:hover { color: #4de2ba; background: rgba(255, 255, 255, .04); }
.support-widget-attach svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.support-widget-compose-row textarea { width: 100%; min-height: 36px; max-height: 90px; resize: none; padding: 9px 5px; border: 0; color: #eaf1f3; outline: 0; background: transparent; font: inherit; font-size: 11px; line-height: 1.5; }
.support-widget-compose-row > button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; color: #06120f; background: #39dcb1; cursor: pointer; }
.support-widget-compose-row > button:hover { background: #55e8c1; }
.support-widget-compose-row > button:disabled { cursor: wait; opacity: .55; }
.support-widget-compose-row > button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.support-widget-composer > small { display: block; margin: 4px 4px 0 39px; color: #ff8189; font-size: 9px; }
.support-widget-composer > small:empty { display: none; }

@media (max-width: 600px) {
  .support-widget { right: 16px; bottom: 16px; }
  .support-widget-panel { inset: 12px !important; width: auto; max-height: none; border-radius: 18px; }
  .support-widget-body { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .support-widget-panel { animation: none; }
  .support-widget-launcher { transition: none; }
}
