#gbChat {
  --gc-bg: rgba(255, 255, 255, 0.96);
  --gc-bg-solid: #ffffff;
  --gc-soft: #f5f7fb;
  --gc-soft-2: #eef2f7;
  --gc-text: #111827;
  --gc-muted: #6b7280;
  --gc-line: rgba(15, 23, 42, 0.08);
  --gc-blue: #2563eb;
  --gc-blue-strong: #1d4ed8;
  --gc-success: #10b981;
  --gc-danger: #dc2626;
  --gc-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  --gc-shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.12);
  --gc-radius: 20px;
  --gc-radius-sm: 14px;
  color: var(--gc-text);
  font: 15px/1.55 "Inter", "Tiro Bangla", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[data-theme="dark"] #gbChat {
  --gc-bg: rgba(17, 24, 39, 0.94);
  --gc-bg-solid: #111827;
  --gc-soft: #1f2937;
  --gc-soft-2: #273244;
  --gc-text: #f9fafb;
  --gc-muted: #9ca3af;
  --gc-line: rgba(255, 255, 255, 0.08);
  --gc-blue: #60a5fa;
  --gc-blue-strong: #3b82f6;
  --gc-success: #34d399;
  --gc-danger: #f87171;
  --gc-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  --gc-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.28);
}

#gbChat [hidden] {
  display: none !important;
}

#gbChat,
#gbChat * {
  box-sizing: border-box;
}

#gbChat button,
#gbChat input,
#gbChat textarea {
  font: inherit;
}

#gbChat .gc-compose button {
  padding: 0;
  display: grid;
  place-items: center;
}

#gbChat button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: transparent;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

#gbChat button:focus-visible,
#gbChat input:focus-visible,
#gbChat textarea:focus-visible {
  outline: 2px solid var(--gc-blue);
  outline-offset: 2px;
}

#gbChat .gc-window,
#gbChat .gc-inbox {
  position: fixed;
  z-index: 1500;
  background: var(--gc-bg);
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius);
  box-shadow: var(--gc-shadow);
  overflow: hidden;
  overflow: clip;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

#gbChat .gc-window {
  right: 88px;
  bottom: 18px;
  width: 380px;
  height: min(560px, 86dvh);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(44, 64, 119, 0.20), rgba(13, 20, 37, 0) 120px),
    linear-gradient(180deg, #0f172a 0%, #111b31 100%);
  border: 1px solid rgba(96, 165, 250, 0.16);
  box-shadow: 0 28px 60px rgba(2, 6, 23, 0.42);
}

/* The site header/footer styles use fixed positioning; keep chat internals inside the chat window. */
#gbChat .gc-window > header,
#gbChat .gc-window > .gc-history,
#gbChat .gc-window > .gc-error,
#gbChat .gc-window > .gc-emoji-panel,
#gbChat .gc-window > .gc-photo-progress,
#gbChat .gc-window > .gc-voice-preview,
#gbChat .gc-window > .gc-voice-recording,
#gbChat .gc-window > .gc-compose,
#gbChat .gc-inbox > header,
#gbChat .gc-inbox > .gc-conversations {
  position: relative !important;
  inset: auto !important;
  width: auto !important;
}

#gbChat .gc-inbox {
  width: 380px;
  max-height: 72dvh;
  right: 20px;
  top: 76px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
}

#gbChat header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gc-line);
  flex-shrink: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0)),
    var(--gc-bg);
}

#gbChat .gc-window > header {
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.2), transparent 34%),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 52%, #2563eb 100%);
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, .16);
  padding: 15px 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}
#gbChat .gc-window > header .gc-name,
#gbChat .gc-window > header .gc-presence { color: #fff; }
#gbChat .gc-window > header .gc-presence {
  opacity: .92;
  color: rgba(255,255,255,0.78);
}
#gbChat .gc-window > header button { color: #fff; }
#gbChat .gc-window > header button:hover { color: #fff; }
html[data-theme="dark"] #gbChat .gc-window > header {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.08), transparent 30%),
    linear-gradient(135deg, #020617 0%, #172554 48%, #1d4ed8 100%);
}
#gbChat[data-page="2"] .gc-head { display: none !important; }
#gbChat[data-page="2"] [data-chat-back] { display: grid; place-items: center; }
#gbChat[data-page="2"] [data-close-inbox] { display: none; }
#gbChat[data-page="2"] [data-close] { display: none; }
#gbChat.gc-inbox-page { min-height: min(720px, calc(100dvh - 185px)); }
#gbChat.gc-inbox-page .gc-inbox {
  position: relative;
  top: auto;
  right: auto;
  width: 100%;
  max-height: none;
  border-radius: var(--gc-radius);
  box-shadow: var(--gc-shadow-soft);
}

html[data-theme="dark"] #gbChat header {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
    var(--gc-bg);
}

#gbChat .gc-inbox header {
  justify-content: space-between;
}

#gbChat .gc-inbox header strong {
  font-size: 17px;
  font-weight: 700;
}

#gbChat header button {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: var(--gc-muted);
  font: 18px/1 sans-serif;
  border-radius: 999px;
}

#gbChat header button:hover {
  background: var(--gc-soft);
  color: var(--gc-text);
}

#gbChat .gc-identity {
  flex: 1;
  min-width: 0;
}

#gbChat .gc-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .01em;
  color: var(--gc-text);
}

#gbChat .gc-presence {
  display: block;
  color: var(--gc-muted);
  font-size: 12px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

#gbChat .gc-presence.is-active::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

#gbChat [data-chat-back] { display: none; }

#gbChat .gc-avatar,
#gbChat .gc-head-avatar,
#gbChat .gc-person-avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(219,234,254,0.92));
  border: 2px solid rgba(255,255,255,0.34);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.18), inset 0 1px 0 rgba(255,255,255,0.45);
}

#gbChat img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#gbChat .gc-history {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 12px 10px;
  background:
    radial-gradient(circle at top, rgba(96, 165, 250, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(16, 24, 40, 0.10), rgba(16, 24, 40, 0)),
    transparent;
}

#gbChat .gc-history::-webkit-scrollbar,
#gbChat .gc-conversations::-webkit-scrollbar {
  width: 10px;
}

#gbChat .gc-history::-webkit-scrollbar-thumb,
#gbChat .gc-conversations::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.24);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

#gbChat .gc-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 10px 0;
  position: relative;
}

#gbChat .gc-row.mine {
  justify-content: flex-end;
}

#gbChat .gc-message {
  max-width: calc(100% - 48px);
  min-width: 0;
}

#gbChat .gc-bubble {
  background: var(--gc-soft);
  color: var(--gc-text);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 18px 18px 18px 8px;
  padding: 10px 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: var(--gc-shadow-soft);
}

#gbChat .mine .gc-bubble {
  background: linear-gradient(180deg, var(--gc-blue), var(--gc-blue-strong));
  color: #fff;
  border-color: transparent;
  border-radius: 18px 18px 8px 18px;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

#gbChat .gc-meta {
  display: block;
  color: var(--gc-muted);
  font-size: 11px;
  text-align: right;
  margin: 4px 6px 0;
}

#gbChat .gc-actions {
  position: relative;
  align-self: center;
  flex: 0 0 32px;
}

#gbChat .gc-dots {
  width: 32px;
  height: 32px;
  font: 22px/1 sans-serif;
  border-radius: 999px;
  color: var(--gc-muted);
  background: rgba(255,255,255,0.03);
}

#gbChat .gc-dots:hover {
  background: var(--gc-soft);
  color: var(--gc-text);
}

#gbChat .gc-menu,
.gc-menu {
  position: fixed;
  z-index: 100050;
  min-width: 184px;
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 22px 50px rgba(2, 6, 23, 0.32);
  border-radius: 16px;
  padding: 7px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

#gbChat .gc-menu button,
.gc-menu button {
  display: block;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  color: #e5eefc;
  white-space: nowrap;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border: 0;
  cursor: pointer;
}

#gbChat .gc-menu button:hover,
.gc-menu button:hover {
  background: rgba(255,255,255,0.08);
}

#gbChat .gc-chat-menu button + button,
.gc-chat-menu button + button {
  margin-top: 4px;
}

#gbChat .gc-menu .gc-menu-neutral,
.gc-menu .gc-menu-neutral {
  color: #e5eefc;
}

#gbChat .gc-menu .gc-menu-warn,
.gc-menu .gc-menu-warn {
  color: #fde68a;
}

#gbChat .gc-menu .gc-menu-danger,
.gc-menu .gc-menu-danger {
  color: #fda4af;
}

#gbChat .gc-menu .gc-menu-danger:hover,
.gc-menu .gc-menu-danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

#gbChat .gc-menu .gc-menu-warn:hover,
.gc-menu .gc-menu-warn:hover {
  background: rgba(245, 158, 11, 0.12);
}

#gbChat .gc-error {
  color: var(--gc-danger);
  font-size: 12px;
  margin: 0 14px 8px;
  min-height: 18px;
}

#gbChat .gc-older {
  color: var(--gc-blue);
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
}

#gbChat .gc-older:hover {
  background: rgba(37, 99, 235, 0.14);
}

#gbChat .gc-compose {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}

#gbChat .gc-compose input,
#gbChat .gc-compose textarea {
  width: 0;
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #e5eefc;
  padding: 12px 14px;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.25), 0 0 0 3px rgba(59, 130, 246, 0.08);
  resize: none;
  overflow-y: auto;
  line-height: 1.45;
}

#gbChat .gc-compose input::placeholder,
#gbChat .gc-compose textarea::placeholder {
  color: #93a4c8;
}

#gbChat .gc-compose input:focus,
#gbChat .gc-compose textarea:focus {
  border-color: rgba(96, 165, 250, 0.82);
  background: rgba(15, 23, 42, 0.82);
}

#gbChat .gc-compose button[type="submit"] {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: #fff;
  background: linear-gradient(180deg, var(--gc-blue), var(--gc-blue-strong));
  border-radius: 999px;
  font-size: 16px;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
}

#gbChat .gc-compose button[type="submit"]:hover {
  transform: translateY(-1px);
  opacity: 0.96;
}

#gbChat .gc-compose .gc-tool {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  font-size: 19px;
  color: var(--gc-blue);
  border-radius: 999px;
  background: var(--gc-soft);
}

#gbChat .gc-compose .gc-tool:hover,
#gbChat .gc-compose .gc-tool.is-active {
  background: var(--gc-soft-2);
  color: var(--gc-blue-strong);
}

#gbChat .gc-emoji-panel {
  margin: 0 12px 2px;
  max-height: 220px;
  overflow: hidden;
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius-sm);
  background: var(--gc-bg-solid);
  box-shadow: var(--gc-shadow-soft);
}

#gbChat .gc-emoji-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border-bottom: 1px solid var(--gc-line);
}

#gbChat .gc-emoji-head button {
  color: var(--gc-blue);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 7px;
}

#gbChat .gc-emoji-head button:hover { background: var(--gc-soft); }

#gbChat .gc-emoji-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 2px;
  max-height: 172px;
  overflow-y: auto;
  padding: 8px;
}

#gbChat .gc-emoji-grid button {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 7px;
  font: 21px/1 sans-serif !important;
}

#gbChat .gc-emoji-grid button:hover { background: var(--gc-soft); transform: scale(1.08); }

#gbChat .gc-photo {
  display: block;
  width: min(230px, 100%) !important;
  height: auto !important;
  max-height: 280px;
  border-radius: 13px;
  object-fit: cover !important;
  cursor: pointer;
}

#gbChat .gc-photo-bubble { padding: 4px; background: transparent; border: 0; box-shadow: none; }
#gbChat .mine .gc-photo-bubble { background: transparent; box-shadow: none; }
#gbChat .gc-photo-progress { color: var(--gc-muted); font-size: 12px; padding: 0 14px 7px; }

#gbChat .gc-photo-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 2px;
  padding: 8px;
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius-sm);
  background: var(--gc-soft);
}

#gbChat .gc-photo-preview img {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 9px;
  object-fit: cover;
}

#gbChat .gc-photo-preview span {
  flex: 1;
  min-width: 0;
  color: var(--gc-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#gbChat .gc-photo-preview button {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  color: var(--gc-muted);
  background: var(--gc-bg-solid);
}

#gbChat .gc-compose button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

#gbChat .gc-conversations {
  overflow: auto;
  padding: 10px;
}

#gbChat .gc-person {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 16px;
  align-items: center;
}

#gbChat .gc-person:hover {
  background: var(--gc-soft);
}

#gbChat .gc-person-copy {
  flex: 1;
  min-width: 0;
}

#gbChat .gc-person-copy strong,
#gbChat .gc-person-copy small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#gbChat .gc-person-copy strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--gc-text);
}

#gbChat .gc-person-copy small {
  color: var(--gc-muted);
  margin-top: 2px;
  font-size: 12px;
}

#gbChat .gc-unread {
  align-self: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gc-blue), var(--gc-blue-strong));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

#gbChat .gc-head {
  position: fixed;
  right: 18px;
  bottom: 24px;
  z-index: 1501;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: var(--gc-shadow);
  background: var(--gc-bg-solid);
  border: 1px solid rgba(37, 99, 235, 0.2);
  overflow: visible;
}

#gbChat .gc-head:hover {
  transform: translateY(-2px);
}

#gbChat .gc-head-avatar {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(37, 99, 235, 0.14);
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
}

#gbChat .gc-head-close {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gc-bg-solid);
  border-radius: 50%;
  background: var(--gc-soft-2);
  color: var(--gc-muted);
  font: 14px/1 Arial, sans-serif;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .2);
  z-index: 3;
}

#gbChat .gc-head-close:hover { background: var(--gc-danger); color: #fff; }

html[data-theme="dark"] #gbChat .gc-head-avatar {
  background: linear-gradient(180deg, #1f2937, #111827);
}

#gbChat .gc-badge {
  position: absolute;
  left: -6px;
  top: -5px;
  background: linear-gradient(180deg, #ef4444, #dc2626);
  color: #fff;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 8px 14px rgba(220, 38, 38, 0.28);
  z-index: 2;
}

#gbChat.gc-page-mode {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 16px;
  height: min(720px, calc(100dvh - 185px));
  min-height: 520px;
}

#gbChat.gc-page-mode .gc-inbox,
#gbChat.gc-page-mode .gc-window {
  position: relative !important;
  inset: auto !important;
  width: auto !important;
  height: 100% !important;
  max-height: none !important;
  min-width: 0 !important;
  right: auto !important;
  bottom: auto !important;
  border-radius: var(--gc-radius);
  box-shadow: var(--gc-shadow-soft);
  z-index: 1 !important;
}

#gbChat.gc-page-mode .gc-inbox:not([hidden]) { display: flex !important; }
#gbChat.gc-page-mode .gc-window:not([hidden]) { display: flex !important; }
#gbChat.gc-page-mode .gc-inbox[hidden],
#gbChat.gc-page-mode .gc-window[hidden] { display: none !important; }
#gbChat.gc-page-mode .gc-head { display: none !important; }
#gbChat.gc-page-mode [data-close-inbox],
#gbChat.gc-page-mode [data-minimize],
#gbChat.gc-page-mode [data-close] { display: none !important; }

#gbChat.gc-page-mode .gc-window > header {
  max-height: none !important;
  min-height: 78px !important;
  grid-template-columns: 44px minmax(0, 1fr) 40px 40px 40px !important;
  border-radius: var(--gc-radius) var(--gc-radius) 0 0 !important;
}

#gbChat.gc-page-mode .gc-window > header [data-close] {
  display: none !important;
  position: static !important;
  top: auto !important;
  right: auto !important;
}

#gbChat.gc-page-mode [data-chat-back],
#gbChat.gc-page-mode .gc-window > header [data-chat-back] {
  display: none !important;
}

@media (max-width: 540px) {
  #gbChat .gc-inbox {
    right: 8px;
    width: calc(100% - 16px);
    top: 68px;
  }

  #gbChat .gc-head {
    bottom: 84px;
    right: 12px;
  }

  #gbChat .gc-compose { gap: 5px; padding: 9px; }
  #gbChat .gc-compose .gc-tool { width: 36px; height: 36px; flex-basis: 36px; }
  #gbChat .gc-compose button[type="submit"] { width: 38px; height: 38px; flex-basis: 38px; }
  #gbChat .gc-compose input { padding: 10px 12px; }
  #gbChat .gc-emoji-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  #gbChat.gc-page-mode {
    display: block;
    height: calc(100dvh - 190px);
    min-height: 500px;
  }
  #gbChat.gc-page-mode .gc-inbox,
  #gbChat.gc-page-mode .gc-window {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: var(--gc-radius);
  }
  #gbChat.gc-page-mode .gc-window > header {
    grid-template-columns: 40px 42px minmax(0, 1fr) 38px 38px 38px !important;
  }
  #gbChat.gc-page-mode [data-chat-back],
  #gbChat.gc-page-mode .gc-window > header [data-chat-back] {
    display: grid !important;
    place-items: center !important;
  }
}

#gbChat .gc-window > header {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 14px;
}

#gbChat .gc-head-action,
#gbChat .gc-call-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 10px 24px rgba(2, 6, 23, 0.12);
  color: #fff;
}

#gbChat .gc-head-action i,
#gbChat .gc-call-btn i {
  font-size: 15px;
}

#gbChat [data-chat-menu] i {
  font-size: 15px;
}

#gbChat .gc-head-back {
  background: rgba(15, 23, 42, 0.22);
}

#gbChat .gc-head-action-min {
  background: rgba(99, 102, 241, 0.24);
  border-color: rgba(199, 210, 254, 0.18);
}

#gbChat .gc-head-action-min i {
  font-size: 13px;
  transform: translateY(1px);
}

#gbChat .gc-head-action-danger {
  background: rgba(168, 85, 247, 0.26);
  border-color: rgba(233, 213, 255, 0.18);
}

#gbChat .gc-head-action:hover,
#gbChat .gc-call-btn:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

#gbChat .gc-head-action-danger:hover {
  background: rgba(168, 85, 247, 0.38);
}

#gbChat .gc-window > header::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.08), rgba(255,255,255,0.35), rgba(255,255,255,0.08));
}

#gbChat .gc-window > header .gc-identity {
  align-self: center;
}

#gbChat .gc-window > header .gc-name {
  text-shadow: 0 1px 1px rgba(0,0,0,0.16);
}

#gbChat .gc-window > header .gc-avatar {
  position: relative;
}

#gbChat .gc-window > header .gc-avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
  pointer-events: none;
}

html[data-theme="dark"] #gbChat .gc-window > header .gc-avatar {
  background: linear-gradient(180deg, rgba(148,163,184,0.25), rgba(96,165,250,0.2));
  border-color: rgba(255,255,255,0.16);
}

#gbChat .gc-call-btn {
  background: rgba(16, 185, 129, 0.28);
  border-color: rgba(167, 243, 208, 0.18);
}

#gbChat .gc-call-btn:hover {
  background: rgba(16, 185, 129, 0.40);
}

#gbChat .gc-voice-recording {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.18);
}

#gbChat .gc-voice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gc-danger);
  animation: gcVoicePulse 1s ease-in-out infinite;
}

@keyframes gcVoicePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

#gbChat .gc-voice-timer {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 42px;
}

#gbChat .gc-voice-rec-label {
  flex: 1;
  color: var(--gc-muted);
  font-size: 13px;
}

#gbChat .gc-voice-stop {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gc-danger);
  color: #fff;
  display: grid;
  place-items: center;
}

#gbChat .gc-voice-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--gc-soft);
  border: 1px solid var(--gc-line);
}

#gbChat .gc-voice-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gc-blue);
  color: #fff;
  display: grid;
  place-items: center;
}

#gbChat .gc-voice-meta {
  flex: 1;
  font-size: 13px;
  color: var(--gc-muted);
}

#gbChat .gc-send-voice {
  background: linear-gradient(180deg, var(--gc-blue), var(--gc-blue-strong));
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

#gbChat .gc-tool.is-active {
  background: rgba(37, 99, 235, 0.16);
  color: var(--gc-blue);
}

#gbChat .gc-audio-bubble audio {
  width: min(240px, 68vw);
  height: 36px;
}

#gbChat .gc-call-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, 0.72);
  display: grid;
  place-items: center;
  padding: 16px;
}

#gbChat .gc-call-card {
  width: 100%;
  max-width: 320px;
  background: linear-gradient(180deg, #1e3c72 0%, #0f172a 100%);
  color: #fff;
  border-radius: 24px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

#gbChat .gc-call-avatar {
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 700;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.25);
}

#gbChat .gc-call-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#gbChat .gc-call-name {
  display: block;
  font-size: 22px;
  margin-bottom: 6px;
}

#gbChat .gc-call-status {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 18px;
}

#gbChat .gc-call-wave {
  display: flex;
  justify-content: center;
  gap: 5px;
  height: 34px;
  align-items: flex-end;
  margin-bottom: 22px;
}

#gbChat .gc-call-wave span {
  width: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  animation: gcCallWave 1.1s ease-in-out infinite;
}

#gbChat .gc-call-wave span:nth-child(2) { animation-delay: .12s; height: 18px; }
#gbChat .gc-call-wave span:nth-child(3) { animation-delay: .24s; height: 28px; }
#gbChat .gc-call-wave span:nth-child(4) { animation-delay: .36s; height: 20px; }
#gbChat .gc-call-wave span:nth-child(5) { animation-delay: .48s; height: 14px; }
#gbChat .gc-call-wave span:nth-child(1) { height: 12px; }
#gbChat .gc-call-wave span:nth-child(5) { height: 14px; }

@keyframes gcCallWave {
  0%, 100% { transform: scaleY(0.55); opacity: 0.55; }
  50% { transform: scaleY(1); opacity: 1; }
}

#gbChat .gc-call-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 14px;
}

#gbChat .gc-call-action {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

#gbChat .gc-call-end {
  background: #ef4444;
  transform: scale(1.08);
}

#gbChat .gc-call-note {
  font-size: 11px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62);
}

/* Screenshot-matched premium dark chat skin */
#gbChat .gc-window {
  width: 380px !important;
  min-width: 380px !important;
  height: 546px !important;
  max-height: calc(100dvh - 22px);
  right: 48px !important;
  bottom: 8px !important;
  border-radius: 18px !important;
  background:
    radial-gradient(circle at 18% 36%, rgba(36, 74, 145, 0.16), transparent 30%),
    linear-gradient(180deg, #101a2e 0%, #0d1626 58%, #0d1626 100%) !important;
  border: 1px solid rgba(76, 119, 191, 0.28) !important;
  box-shadow: 0 22px 58px rgba(2, 8, 23, 0.55) !important;
  overflow: hidden !important;
}

#gbChat .gc-window > header {
  min-height: 94px !important;
  grid-template-columns: 42px 44px minmax(0, 1fr) 40px 40px 40px !important;
  gap: 8px !important;
  padding: 17px 18px 16px !important;
  background:
    radial-gradient(circle at 18% 16%, rgba(255,255,255,0.16), transparent 28%),
    linear-gradient(135deg, #18265d 0%, #1f46ba 60%, #2554d9 100%) !important;
  border-bottom: 1px solid rgba(118, 164, 255, 0.18) !important;
  box-shadow: none !important;
}

#gbChat .gc-window > header::after {
  display: none !important;
}

#gbChat .gc-window > header .gc-avatar {
  width: 42px !important;
  height: 42px !important;
  border: 2px solid rgba(255,255,255,0.72) !important;
  background: #eef5ff !important;
  box-shadow: 0 7px 18px rgba(2, 8, 23, 0.24) !important;
}

#gbChat .gc-window > header .gc-identity {
  min-width: 0 !important;
  overflow: hidden !important;
}

#gbChat .gc-window > header .gc-name {
  max-width: 100% !important;
  font-size: 15px !important;
  line-height: 1.15 !important;
  font-weight: 800 !important;
  color: #fff !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-shadow: none !important;
}

#gbChat .gc-window > header .gc-presence {
  max-width: 100% !important;
  margin-top: 4px !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  color: rgba(255,255,255,0.86) !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  word-break: break-word !important;
}

#gbChat .gc-window > header .gc-presence.is-active::before {
  width: 6px !important;
  height: 6px !important;
  margin-right: 5px !important;
  background: #ef4444 !important;
  box-shadow: none !important;
}

#gbChat .gc-head-action,
#gbChat .gc-call-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255,255,255,0.13) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 9px 18px rgba(0,0,0,0.16) !important;
}

#gbChat .gc-head-back {
  background: rgba(16, 27, 56, 0.42) !important;
}

#gbChat .gc-call-btn {
  background: rgba(10, 132, 120, 0.58) !important;
}

#gbChat .gc-head-action-min {
  background: rgba(55, 76, 151, 0.62) !important;
}

#gbChat .gc-head-action-danger {
  background: rgba(92, 70, 158, 0.66) !important;
}

#gbChat .gc-head-action:hover,
#gbChat .gc-call-btn:hover {
  transform: none !important;
  filter: brightness(1.12);
}

#gbChat [data-chat-menu] {
  /* header grid placement handled below — do not absolute-offset into history */
  position: relative;
}

#gbChat .gc-history {
  padding: 16px 12px 12px !important;
  background:
    radial-gradient(circle at 14% 44%, rgba(59, 130, 246, 0.09), transparent 28%),
    linear-gradient(180deg, #0f1829 0%, #0c1422 100%) !important;
}

#gbChat .gc-compose {
  gap: 8px !important;
  padding: 12px !important;
  background: #0d1626 !important;
  border-top: 1px solid rgba(72, 105, 163, 0.22) !important;
}

#gbChat .gc-compose .gc-tool {
  width: 38px !important;
  height: 38px !important;
  flex-basis: 38px !important;
  background: rgba(31, 46, 76, 0.95) !important;
  color: #5fa4ff !important;
}

#gbChat .gc-compose input {
  height: 42px !important;
  border: 1px solid rgba(86, 151, 255, 0.75) !important;
  background: #0f1a2b !important;
  color: #e8f0ff !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18), inset 0 1px 3px rgba(0,0,0,0.26) !important;
}

#gbChat .gc-compose button[type="submit"],
#gbChat .gc-send-voice {
  width: 44px !important;
  height: 44px !important;
  flex-basis: 44px !important;
  background: linear-gradient(180deg, #5aa2ff 0%, #3678f6 100%) !important;
  box-shadow: 0 10px 20px rgba(54, 120, 246, 0.28) !important;
}

#gbChat .gc-bubble {
  background: rgba(49, 59, 76, 0.92) !important;
  color: #f4f7fb !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  box-shadow: none !important;
}

#gbChat .mine .gc-bubble {
  background: linear-gradient(180deg, #5a9cff 0%, #387df6 100%) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 8px 18px rgba(56, 125, 246, 0.22) !important;
}

#gbChat .gc-meta {
  color: rgba(203, 213, 225, 0.78) !important;
}

#gbChat .gc-audio-bubble {
  background: rgba(59, 67, 82, 0.95) !important;
  padding: 9px 12px !important;
  border-radius: 15px !important;
}

@media (max-width: 540px) {
  #gbChat .gc-window {
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    width: calc(100% - 16px) !important;
    min-width: 0 !important;
    height: min(546px, 88dvh) !important;
  }

  #gbChat .gc-window > header {
    grid-template-columns: 42px 42px minmax(0, 1fr) 38px 38px 38px !important;
    gap: 7px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* Final reference skin: match the supplied chat mockup */
#gbChat:not(.gc-page-mode) .gc-window {
  width: 380px !important;
  min-width: 380px !important;
  height: 560px !important;
  border-radius: 24px !important;
  overflow: visible !important;
}

#gbChat .gc-window > header {
  min-height: 66px !important;
  max-height: 76px !important;
  grid-template-columns: 44px minmax(0, 1fr) 38px 38px 38px !important;
  padding: 12px 14px !important;
  gap: 8px !important;
  align-items: center !important;
  background:
    radial-gradient(circle at 16% 20%, rgba(34, 211, 238, 0.18), transparent 26%),
    linear-gradient(135deg, #071f4d 0%, #0b3aa0 54%, #1265f5 100%) !important;
  border-bottom: 1px solid rgba(93, 167, 255, 0.42) !important;
  border-radius: 24px 24px 0 0 !important;
  position: relative !important;
  overflow: visible !important;
}

#gbChat .gc-window > header [data-chat-back],
#gbChat .gc-window > header [data-minimize] {
  display: none !important;
}

#gbChat .gc-window > header [data-close] {
  display: inline-flex !important;
  position: absolute !important;
  top: -14px !important;
  right: -14px !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 50% !important;
  background: #091a3e !important;
  border: 2px solid #38bdf8 !important;
  color: #fff !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 100 !important;
  padding: 0 !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 14px rgba(56, 189, 248, 0.5) !important;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

#gbChat .gc-window > header [data-close]:hover {
  background: #ef4444 !important;
  border-color: #fca5a5 !important;
  color: #fff !important;
  transform: scale(1.15) rotate(90deg) !important;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.7) !important;
}

#gbChat .gc-window > header [data-close] i {
  font-size: 15px !important;
  color: #fff !important;
  line-height: 1 !important;
}

#gbChat .gc-window > header .gc-avatar {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  grid-column: 1 !important;
  border: 2px solid rgba(255,255,255,0.88) !important;
  background: #fff !important;
  border-radius: 50% !important;
}

#gbChat .gc-window > header .gc-identity {
  grid-column: 2 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

#gbChat .gc-window > header .gc-name {
  font-size: 15px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  letter-spacing: -0.1px !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: block !important;
  margin: 0 !important;
}

#gbChat .gc-window > header .gc-presence {
  margin-top: 3px !important;
  font-size: 11.5px !important;
  line-height: 1.3 !important;
  color: rgba(236, 245, 255, 0.88) !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  display: block !important;
  word-break: break-word !important;
}

#gbChat .gc-window > header .gc-presence.is-active::before {
  width: 7.5px !important;
  height: 7.5px !important;
  margin-right: 5px !important;
  background: #18d56b !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

#gbChat .gc-window > header .gc-call-btn,
#gbChat .gc-window > header [data-chat-menu] {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255,255,255,0.22) !important;
  background: rgba(4, 24, 61, 0.34) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 4px 12px rgba(0,0,0,0.16) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

#gbChat .gc-window > header .gc-call-btn:hover,
#gbChat .gc-window > header [data-chat-menu]:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  transform: translateY(-1px) !important;
}

#gbChat .gc-window > header [data-audio-call] {
  grid-column: 3 !important;
}

#gbChat .gc-window > header [data-video-call] {
  grid-column: 4 !important;
}

#gbChat .gc-window > header [data-chat-menu] {
  grid-column: 5 !important;
}

#gbChat .gc-window > header .gc-call-btn i,
#gbChat .gc-window > header [data-chat-menu] i {
  font-size: 16px !important;
}

#gbChat .gc-history {
  position: relative !important;
  padding: 26px 22px 14px !important;
  background-color: #061729 !important;
  background-image:
    url("data:image/svg+xml,%3Csvg width='148' height='148' viewBox='0 0 148 148' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23143a61' stroke-width='2' opacity='.20'%3E%3Ccircle cx='28' cy='28' r='16'/%3E%3Cpath d='M19 31c5 5 13 5 18 0M23 23h.1M34 23h.1'/%3E%3Cpath d='M96 24l31 14-31 14 8-14z'/%3E%3Crect x='18' y='95' width='38' height='28' rx='8'/%3E%3Cpath d='M26 108h22M92 94h38v26H92zM101 94l10 10 10-10'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, #061729 0%, #061525 100%) !important;
}

#gbChat .gc-date-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 2px 0 24px;
  color: #cdd9eb;
  font-size: 13px;
}

#gbChat .gc-date-divider::before,
#gbChat .gc-date-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: rgba(99, 140, 192, 0.24);
}

#gbChat .gc-row {
  margin: 14px 0 !important;
}

#gbChat .gc-message {
  max-width: calc(100% - 58px) !important;
}

#gbChat .mine .gc-bubble {
  font-size: 20px !important;
  padding: 14px 22px !important;
  border-radius: 20px 20px 4px 20px !important;
  background: linear-gradient(180deg, #08b8ff 0%, #0966ff 100%) !important;
}

#gbChat .gc-audio-card {
  width: min(220px, 72vw) !important;
  min-height: 46px !important;
  display: grid !important;
  grid-template-columns: 36px 1fr auto 30px !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 7px 10px !important;
  border-radius: 14px !important;
  background: rgba(20, 39, 63, 0.92) !important;
  border: 1px solid rgba(120, 160, 210, 0.22) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05) !important;
}

#gbChat .gc-audio-card audio {
  display: none !important;
}

#gbChat .gc-audio-play,
#gbChat .gc-audio-volume {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
}

#gbChat .gc-audio-play {
  width: 36px;
  height: 36px;
  background: radial-gradient(circle at 35% 25%, #1db8ff, #0d5ff4 70%);
  box-shadow: 0 0 0 1px rgba(42, 164, 255, 0.48), 0 0 14px rgba(0, 132, 255, 0.28);
}

#gbChat .gc-audio-play i {
  font-size: 14px;
  transform: translateX(1px);
}

#gbChat .gc-audio-volume {
  width: 30px;
  height: 30px;
  background: rgba(43, 62, 88, 0.92);
  color: #eaf3ff;
  font-size: 13px;
}

#gbChat .gc-audio-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  overflow: hidden;
}

#gbChat .gc-audio-wave span {
  width: 2px;
  height: var(--h);
  border-radius: 999px;
  background: linear-gradient(180deg, #0ab8ff, #b6c2dc);
  opacity: .92;
}

#gbChat .gc-audio-card.is-playing .gc-audio-wave span {
  animation: gcWaveDance .72s ease-in-out infinite alternate;
}

#gbChat .gc-audio-card.is-playing .gc-audio-wave span:nth-child(2n) {
  animation-delay: .12s;
}

#gbChat .gc-audio-card.is-playing .gc-audio-wave span:nth-child(3n) {
  animation-delay: .22s;
}

@keyframes gcWaveDance {
  from { transform: scaleY(.55); opacity: .64; }
  to { transform: scaleY(1.12); opacity: 1; }
}

#gbChat .gc-audio-time {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

#gbChat .gc-compose {
  min-height: 78px !important;
  padding: 14px 18px !important;
  gap: 12px !important;
  background: rgba(8, 26, 49, 0.98) !important;
  border-top: 1px solid rgba(88, 138, 204, 0.42) !important;
  border-radius: 0 0 24px 24px !important;
}

#gbChat .gc-compose .gc-tool {
  width: 48px !important;
  height: 48px !important;
  flex-basis: 48px !important;
  background: rgba(24, 45, 76, 0.98) !important;
  border: 1px solid rgba(106, 149, 205, 0.18) !important;
  color: #9bc7ff !important;
  font-size: 22px !important;
}

#gbChat .gc-compose input {
  height: 54px !important;
  padding: 0 22px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(87, 143, 230, 0.72) !important;
  background: rgba(7, 17, 34, 0.92) !important;
  color: #dce9ff !important;
  font-size: 15px !important;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.24) !important;
}

#gbChat .gc-compose input::placeholder {
  color: #9aa9c2 !important;
}

#gbChat .gc-compose button[type="submit"],
#gbChat .gc-send-voice {
  width: 58px !important;
  height: 58px !important;
  flex-basis: 58px !important;
  background: linear-gradient(180deg, #16c5ff 0%, #0a75ff 100%) !important;
  box-shadow: 0 10px 26px rgba(6, 127, 255, 0.42) !important;
  font-size: 24px !important;
}

#gbChat .gc-menu.gc-chat-menu {
  min-width: 190px !important;
}

@media (max-width: 540px) {
  #gbChat:not(.gc-page-mode) .gc-window {
    width: calc(100% - 16px) !important;
    min-width: 0 !important;
    height: min(560px, 88dvh) !important;
  }

  #gbChat .gc-window > header {
    grid-template-columns: 54px minmax(0, 1fr) 48px 48px !important;
    padding: 20px 18px !important;
  }

  #gbChat .gc-window > header .gc-avatar {
    width: 54px !important;
    height: 54px !important;
  }

  #gbChat .gc-window > header .gc-name {
    font-size: 20px !important;
  }

  #gbChat .gc-window > header .gc-presence {
    font-size: 12px !important;
  }
}

/* Compact scale for the floating chat widget */
#gbChat:not(.gc-page-mode) .gc-window {
  width: 340px !important;
  min-width: 340px !important;
  height: 500px !important;
  right: 28px !important;
  bottom: 8px !important;
  border-radius: 18px !important;
}

#gbChat:not(.gc-page-mode) .gc-window > header {
  min-height: 88px !important;
  max-height: none !important;
  grid-template-columns: 42px minmax(0, 1fr) 36px 36px 36px !important;
  gap: 8px !important;
  padding: 14px 14px 12px !important;
  border-radius: 18px 18px 0 0 !important;
  align-items: center !important;
}

#gbChat:not(.gc-page-mode) .gc-window > header .gc-avatar {
  width: 42px !important;
  height: 42px !important;
  border-width: 2px !important;
}

#gbChat:not(.gc-page-mode) .gc-window > header .gc-identity {
  overflow: visible !important;
}

#gbChat:not(.gc-page-mode) .gc-window > header .gc-name {
  font-size: 15px !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
}

#gbChat:not(.gc-page-mode) .gc-window > header .gc-presence {
  margin-top: 3px !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  word-break: break-word !important;
}

#gbChat:not(.gc-page-mode) .gc-window > header .gc-presence.is-active::before {
  width: 8px !important;
  height: 8px !important;
  margin-right: 5px !important;
}

#gbChat:not(.gc-page-mode) .gc-window > header .gc-call-btn,
#gbChat:not(.gc-page-mode) .gc-window > header [data-chat-menu] {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
}

#gbChat:not(.gc-page-mode) .gc-window > header .gc-call-btn i,
#gbChat:not(.gc-page-mode) .gc-window > header [data-chat-menu] i {
  font-size: 16px !important;
}

#gbChat:not(.gc-page-mode) .gc-history {
  padding: 18px 14px 10px !important;
}

#gbChat:not(.gc-page-mode) .gc-date-divider {
  margin: 0 0 18px !important;
  font-size: 10px !important;
  gap: 10px !important;
}

#gbChat:not(.gc-page-mode) .mine .gc-bubble {
  font-size: 14px !important;
  padding: 9px 14px !important;
  border-radius: 14px 14px 4px 14px !important;
}

#gbChat:not(.gc-page-mode) .gc-audio-card {
  width: 210px !important;
  min-height: 44px !important;
  grid-template-columns: 34px 1fr auto 28px !important;
  gap: 7px !important;
  padding: 6px 9px !important;
  border-radius: 12px !important;
}

#gbChat:not(.gc-page-mode) .gc-audio-play {
  width: 34px !important;
  height: 34px !important;
}

#gbChat:not(.gc-page-mode) .gc-audio-play i {
  font-size: 13px !important;
}

#gbChat:not(.gc-page-mode) .gc-audio-volume {
  width: 28px !important;
  height: 28px !important;
  font-size: 12px !important;
}

#gbChat:not(.gc-page-mode) .gc-audio-wave {
  height: 22px !important;
  gap: 2px !important;
}

#gbChat:not(.gc-page-mode) .gc-audio-wave span {
  width: 2px !important;
}

#gbChat:not(.gc-page-mode) .gc-audio-time {
  font-size: 11px !important;
}

#gbChat:not(.gc-page-mode) .gc-compose {
  min-height: 58px !important;
  padding: 9px 10px !important;
  gap: 7px !important;
  border-radius: 0 0 18px 18px !important;
  transition: min-height 0.2s ease, padding 0.2s ease;
}

#gbChat:not(.gc-page-mode) .gc-compose .gc-tool {
  width: 34px !important;
  height: 34px !important;
  flex-basis: 34px !important;
  font-size: 16px !important;
}

#gbChat:not(.gc-page-mode) .gc-compose input,
#gbChat:not(.gc-page-mode) .gc-compose textarea {
  font-size: 14px !important;
}

#gbChat:not(.gc-page-mode) .gc-compose button[type="submit"],
#gbChat:not(.gc-page-mode) .gc-send-voice {
  width: 40px !important;
  height: 40px !important;
  flex-basis: 40px !important;
  font-size: 17px !important;
}

@media (max-width: 768px) {
  /* Strictly hide when hidden attribute is present */
  #gbChat .gc-window[hidden],
  #gbChat:not(.gc-page-mode) .gc-window[hidden],
  #gbChat [hidden] {
    display: none !important;
  }

  /* Only display fullscreen when active/opened (not hidden) */
  #gbChat .gc-window:not([hidden]),
  #gbChat:not(.gc-page-mode) .gc-window:not([hidden]) {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    background: #000000 !important;
    overflow: hidden !important;
  }

  /* Fullscreen Messenger Mobile Header */
  #gbChat .gc-window > header {
    min-height: 58px !important;
    height: 58px !important;
    max-height: 58px !important;
    display: flex !important;
    align-items: center !important;
    padding: 6px 10px !important;
    gap: 8px !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: #000000 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6) !important;
    overflow: visible !important;
    grid-template-columns: none !important;
  }

  /* Back arrow button on mobile (Messenger style) */
  #gbChat .gc-window > header [data-chat-back] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: none !important;
    color: #0084ff !important;
    font-size: 20px !important;
    cursor: pointer !important;
    padding: 0 !important;
  }
  #gbChat .gc-window > header [data-chat-back]:hover {
    background: rgba(255, 255, 255, 0.1) !important;
  }

  /* Hide desktop external floating close badge & minimize on mobile */
  #gbChat .gc-window > header [data-close],
  #gbChat .gc-window > header [data-minimize] {
    display: none !important;
  }

  /* Avatar in mobile header */
  #gbChat .gc-window > header .gc-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 50% !important;
    margin: 0 !important;
  }

  /* Name & presence in mobile header */
  #gbChat .gc-window > header .gc-identity {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    margin: 0 4px !important;
    overflow: visible !important;
  }

  #gbChat .gc-window > header {
    min-height: 78px !important;
    padding-top: 14px !important;
    padding-bottom: 12px !important;
    align-items: center !important;
  }

  #gbChat .gc-window > header .gc-name {
    font-size: 16.5px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    letter-spacing: -0.1px !important;
  }

  #gbChat .gc-window > header .gc-presence {
    margin-top: 3px !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    color: rgba(255, 255, 255, 0.72) !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word !important;
  }

  #gbChat .gc-window > header .gc-presence.is-active::before {
    width: 6.5px !important;
    height: 6.5px !important;
    margin-right: 4px !important;
  }

  /* Right action buttons in mobile header */
  #gbChat .gc-window > header .gc-call-btn,
  #gbChat .gc-window > header [data-chat-menu] {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: none !important;
    color: #0084ff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  #gbChat .gc-window > header .gc-call-btn:hover,
  #gbChat .gc-window > header [data-chat-menu]:hover {
    background: rgba(255, 255, 255, 0.1) !important;
  }

  #gbChat .gc-window > header .gc-call-btn i,
  #gbChat .gc-window > header [data-chat-menu] i {
    font-size: 18px !important;
    color: #0084ff !important;
  }

  /* Fullscreen History Container */
  #gbChat .gc-window > .gc-history {
    flex: 1 1 auto !important;
    height: auto !important;
    padding: 12px 10px !important;
    background: #000000 !important;
    overflow-y: auto !important;
  }

  /* Mobile Messenger Bubble Styling */
  #gbChat .gc-window .gc-bubble {
    font-size: 15px !important;
    line-height: 1.4 !important;
    border-radius: 18px !important;
    padding: 9px 14px !important;
    max-width: 78% !important;
  }

  #gbChat .gc-window .gc-row:not(.mine) .gc-bubble {
    background: #262626 !important;
    color: #ffffff !important;
    border: none !important;
    border-bottom-left-radius: 4px !important;
  }

  #gbChat .gc-window .mine .gc-bubble {
    background: #0084ff !important;
    color: #ffffff !important;
    border: none !important;
    border-bottom-right-radius: 4px !important;
  }

  /* Fullscreen Compose Bar at Bottom */
  #gbChat .gc-window > .gc-compose {
    border-radius: 0 !important;
    padding: 8px 8px max(10px, env(safe-area-inset-bottom)) !important;
    background: #000000 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    min-height: 54px !important;
    gap: 6px !important;
  }

  #gbChat .gc-window > .gc-compose .gc-tool {
    width: 34px !important;
    height: 34px !important;
    flex-basis: 34px !important;
    color: #0084ff !important;
    background: transparent !important;
    border: none !important;
    font-size: 18px !important;
  }

  #gbChat .gc-window > .gc-compose textarea.gc-message-input {
    border-radius: 20px !important;
    background: #1e1e1e !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
    font-size: 15px !important;
    padding: 8px 14px !important;
    min-height: 36px !important;
  }

  #gbChat .gc-window > .gc-compose button[type="submit"],
  #gbChat .gc-window > .gc-send-voice {
    width: 36px !important;
    height: 36px !important;
    flex-basis: 36px !important;
    color: #0084ff !important;
    background: transparent !important;
    border: none !important;
    font-size: 18px !important;
    box-shadow: none !important;
  }
}

#gbChat .gc-compose {
  align-items: flex-end !important;
}

#gbChat .gc-message-input {
  display: block !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, 0.45) transparent;
}

#gbChat .gc-message-input::-webkit-scrollbar {
  width: 5px;
}

#gbChat .gc-message-input::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.45);
  border-radius: 999px;
}

#gbChat:not(.gc-page-mode) .gc-compose textarea.gc-message-input {
  height: 38px;
  min-height: 38px !important;
  max-height: 110px !important;
  padding: 10px 14px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(87, 143, 230, 0.72) !important;
  background: rgba(7, 17, 34, 0.92) !important;
  color: #dce9ff !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.24) !important;
  white-space: pre-wrap !important;
  overflow-y: hidden;
}

#gbChat:not(.gc-page-mode) .gc-compose.is-expanded {
  min-height: 102px !important;
}

#gbChat:not(.gc-page-mode) .gc-compose.is-expanded .gc-tool {
  width: 0 !important;
  height: 0 !important;
  flex-basis: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-width: 0 !important;
}

@media (min-width: 541px) {
  #gbChat:not(.gc-page-mode) .gc-message-input::-webkit-scrollbar {
    width: 6px;
  }
}

@media (max-width: 540px) {
  #gbChat:not(.gc-page-mode) .gc-compose textarea.gc-message-input {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #gbChat:not(.gc-page-mode) .gc-compose textarea.gc-message-input::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-window {
  background:
    radial-gradient(circle at 18% 32%, rgba(96, 165, 250, 0.12), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%) !important;
  border: 1px solid rgba(96, 165, 250, 0.18) !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16) !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-window > header {
  background:
    radial-gradient(circle at 16% 20%, rgba(255,255,255,0.22), transparent 28%),
    linear-gradient(135deg, #0f56d8 0%, #2378ff 54%, #43a2ff 100%) !important;
  border-bottom: 1px solid rgba(112, 163, 255, 0.32) !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-history {
  background-color: #eef5ff !important;
  background-image:
    url("data:image/svg+xml,%3Csvg width='148' height='148' viewBox='0 0 148 148' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%239bb9e5' stroke-width='2' opacity='.23'%3E%3Ccircle cx='28' cy='28' r='16'/%3E%3Cpath d='M19 31c5 5 13 5 18 0M23 23h.1M34 23h.1'/%3E%3Cpath d='M96 24l31 14-31 14 8-14z'/%3E%3Crect x='18' y='95' width='38' height='28' rx='8'/%3E%3Cpath d='M26 108h22M92 94h38v26H92zM101 94l10 10 10-10'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, #f6faff 0%, #eaf2ff 100%) !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-date-divider {
  color: #55739e !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-date-divider::before,
html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-date-divider::after {
  background: rgba(85, 115, 158, 0.24) !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-bubble,
html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-audio-card {
  background: rgba(255, 255, 255, 0.92) !important;
  color: #183153 !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.16) !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .mine .gc-bubble {
  background: linear-gradient(180deg, #18bcff 0%, #0a75ff 100%) !important;
  color: #fff !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-meta {
  color: #5f7393 !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-audio-volume {
  background: rgba(231, 239, 252, 0.95) !important;
  color: #23406c !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-compose {
  background: rgba(238, 245, 255, 0.98) !important;
  border-top: 1px solid rgba(96, 165, 250, 0.22) !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-compose .gc-tool {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(96, 165, 250, 0.16) !important;
  color: #2878ff !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-compose textarea.gc-message-input {
  background: rgba(255, 255, 255, 0.96) !important;
  color: #183153 !important;
  border: 1px solid rgba(96, 165, 250, 0.42) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.8) !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-compose textarea.gc-message-input::placeholder {
  color: #6b83a5 !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-menu {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14) !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-menu button {
  color: #183153 !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-menu .gc-menu-danger {
  color: #d1435b !important;
}

html:not([data-theme="dark"]) #gbChat:not(.gc-page-mode) .gc-menu .gc-menu-warn {
  color: #b7791f !important;
}

/* Messenger-Style Audio Call Bubble Card */
#gbChat .gc-bubble.gc-call-card-bubble,
#gbChat .mine .gc-bubble.gc-call-card-bubble {
  background: #23272f !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28) !important;
  padding: 8px 10px !important;
  border-radius: 14px !important;
  min-width: 168px;
  max-width: 200px;
  color: #ffffff !important;
}

#gbChat .gc-call-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

#gbChat .gc-call-card-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #ffffff;
  flex-shrink: 0;
}

#gbChat .gc-call-card-icon.is-missed {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

#gbChat .gc-call-card-texts {
  flex: 1;
  min-width: 0;
  text-align: left;
}

#gbChat .gc-call-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

#gbChat .gc-call-card-sub {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 2px;
}

#gbChat .gc-call-card-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: none;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

#gbChat .gc-call-card-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #38bdf8;
  transform: translateY(-1px);
}

#gbChat .gc-call-card-btn i {
  font-size: 11px;
}
