/* Help / support widget (js/support-widget.js) */
.tbs-root {
  --tbs-bg: rgb(12 16 43);
  --tbs-panel: rgb(18 23 49);
  --tbs-input: rgb(7 11 35);
  --tbs-control: rgb(31 37 70);
  --tbs-accent: var(--tb-accent, rgb(43 99 244));
  --tbs-win: rgb(32 208 149);
  --tbs-text: #fff;
  --tbs-muted: rgb(164 170 198);
  --tbs-line: rgba(148, 163, 214, 0.14);
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 170;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: inherit;
  color: var(--tbs-text);
  pointer-events: none;
}
.tbs-root > * {
  pointer-events: auto;
}

.tbs-fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tbs-accent) 88%, #fff 12%), var(--tbs-accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--tbs-accent) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.tbs-fab:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.tbs-fab__icon {
  display: inline-flex;
}
.tbs-fab__dot {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgb(232 48 94);
  box-shadow: 0 0 0 2px var(--tbs-accent);
}
.tbs-root.is-open .tbs-fab__label {
  display: none;
}
.tbs-root.is-open .tbs-fab {
  padding: 0 14px;
}

.tbs-panel {
  width: min(380px, calc(100vw - 32px));
  height: min(600px, calc(100dvh - 120px));
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid var(--tbs-line);
  background:
    radial-gradient(120% 60% at 80% 0%, color-mix(in srgb, var(--tbs-accent) 10%, transparent), transparent 60%),
    var(--tbs-bg);
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  animation: tbs-in 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.tbs-panel[hidden] {
  display: none;
}
@keyframes tbs-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.tbs-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 12px 16px;
  border-bottom: 1px solid var(--tbs-line);
}
.tbs-head__avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tbs-accent) 88%, #fff 12%), var(--tbs-accent));
}
.tbs-head__text {
  flex: 1;
  min-width: 0;
}
.tbs-head__title {
  margin: 0;
  font-weight: 700;
  font-size: 0.9375rem;
}
.tbs-head__status {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--tbs-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tbs-head__status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--tbs-win);
}
.tbs-head__status[data-status="open"]::before {
  background: rgb(245 176 66);
}
.tbs-head__status[data-status="closed"]::before {
  background: var(--tbs-muted);
}
.tbs-icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--tbs-muted);
  cursor: pointer;
}
.tbs-icon-btn:hover {
  background: var(--tbs-control);
  color: #fff;
}

.tbs-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}
.tbs-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  align-self: flex-start;
}
.tbs-msg--user {
  align-self: flex-end;
  align-items: flex-end;
}
.tbs-msg__who {
  margin: 0 0 4px 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tbs-muted);
}
.tbs-msg--admin .tbs-msg__who {
  color: var(--tbs-win);
}
.tbs-bubble {
  padding: 10px 13px;
  border-radius: 16px 16px 16px 6px;
  background: var(--tbs-panel);
  border: 1px solid var(--tbs-line);
  font-size: 0.875rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.tbs-bubble p { margin: 0; }
.tbs-bubble p + p,
.tbs-bubble p + ul, .tbs-bubble p + ol,
.tbs-bubble ul + p, .tbs-bubble ol + p { margin-top: 8px; }
.tbs-bubble ul, .tbs-bubble ol { margin: 0; padding-left: 18px; }
.tbs-bubble li + li { margin-top: 3px; }
.tbs-bubble strong { font-weight: 700; }
.tbs-bubble code {
  font-size: 0.8em;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
}
.tbs-msg--user .tbs-bubble {
  border-radius: 16px 16px 6px 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tbs-accent) 92%, #fff 8%), var(--tbs-accent));
  border-color: transparent;
}
.tbs-msg--admin .tbs-bubble {
  border-color: color-mix(in srgb, var(--tbs-win) 40%, transparent);
  background: color-mix(in srgb, var(--tbs-win) 9%, var(--tbs-panel));
}
.tbs-bubble a {
  color: #8fb0ff;
  text-decoration: underline;
}
.tbs-msg--user .tbs-bubble a {
  color: #fff;
}
.tbs-msg__time {
  margin: 4px 6px 0;
  font-size: 0.6875rem;
  color: color-mix(in srgb, var(--tbs-muted) 75%, transparent);
}

.tbs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tbs-chip {
  border: 1px solid var(--tbs-line);
  background: var(--tbs-input);
  color: var(--tbs-text);
  font-size: 0.8125rem;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.tbs-chip:hover {
  border-color: var(--tbs-accent);
}

.tbs-typing {
  display: flex;
  gap: 4px;
  margin: -4px 16px 8px;
  padding: 10px 13px;
  width: fit-content;
  border-radius: 16px 16px 16px 6px;
  background: var(--tbs-panel);
  border: 1px solid var(--tbs-line);
}
.tbs-typing[hidden] {
  display: none;
}
.tbs-typing span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--tbs-muted);
  animation: tbs-dot 1s infinite ease-in-out;
}
.tbs-typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.tbs-typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes tbs-dot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.tbs-actions {
  display: flex;
  justify-content: center;
  padding: 0 16px;
}
.tbs-actions:has(> :not([hidden])) {
  padding-bottom: 10px;
}
.tbs-human {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--tbs-win) 55%, transparent);
  background: color-mix(in srgb, var(--tbs-win) 12%, transparent);
  color: var(--tbs-win);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
}
.tbs-human:hover {
  background: color-mix(in srgb, var(--tbs-win) 20%, transparent);
}
.tbs-human[hidden],
.tbs-link[hidden] {
  display: none;
}
.tbs-link {
  border: 0;
  background: none;
  color: #8fb0ff;
  font-size: 0.8125rem;
  cursor: pointer;
  text-decoration: underline;
}

.tbs-notice {
  margin: 0 16px 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.8125rem;
  background: rgba(232, 48, 94, 0.12);
  color: #ff9db3;
}
.tbs-notice[hidden],
.tbs-email[hidden] {
  display: none;
}

.tbs-email {
  margin: 0 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tbs-email p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--tbs-muted);
}
.tbs-input,
.tbs-textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 214, 0.22);
  background: var(--tbs-input);
  color: var(--tbs-text);
  font: inherit;
  font-size: 0.875rem;
  padding: 10px 12px;
  outline: none;
}
.tbs-input:focus,
.tbs-textarea:focus {
  border-color: var(--tbs-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tbs-accent) 40%, transparent);
}

.tbs-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px 8px;
  border-top: 1px solid var(--tbs-line);
}
.tbs-textarea {
  resize: none;
  min-height: 42px;
  max-height: 120px;
  line-height: 1.4;
}
.tbs-send {
  flex: 0 0 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tbs-accent) 88%, #fff 12%), var(--tbs-accent));
  color: #fff;
  cursor: pointer;
}
.tbs-send:disabled,
.tbs-textarea:disabled {
  opacity: 0.55;
  cursor: default;
}
.tbs-foot {
  margin: 0;
  padding: 0 14px 10px;
  font-size: 0.6875rem;
  color: color-mix(in srgb, var(--tbs-muted) 80%, transparent);
  text-align: center;
}
.tbs-foot a {
  color: inherit;
  text-decoration: underline;
}

/* Phones: sit above the live-chat button, panel becomes a near-full-screen sheet */
@media (max-width: 767px) {
  .tbs-root {
    right: 16px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
  .tbs-fab {
    height: 44px;
  }
  .tbs-root.is-open {
    left: 0;
    right: 0;
    bottom: 0;
    top: calc(var(--navbar-height, 56px) + 8px);
    gap: 0;
  }
  .tbs-root.is-open .tbs-fab {
    display: none;
  }
  .tbs-root.is-open .tbs-panel {
    width: 100%;
    height: 100%;
    border-radius: 20px 20px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tbs-panel,
  .tbs-typing span {
    animation: none;
  }
}
