/* Global Support Chat windows — logical RTL/LTR, below SweetAlert (1060+) */
.gsc-root {
  position: relative;
}

.gsc-launcher-wrap {
  position: relative;
  overflow: visible;
}

.gsc-launcher-wrap .navbar-action-btn {
  position: relative;
  overflow: visible;
}

.gsc-launcher-wrap .notification-count {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  inset-inline-start: auto;
  min-width: 1.15rem;
  max-width: 2.25rem;
  height: 1.15rem;
  padding-inline: 0.28rem;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Never force-show: initial markup and zero-state use [hidden] + display:none */
.gsc-launcher-wrap .notification-count[hidden],
.gsc-launcher-wrap .notification-count[aria-hidden="true"]:empty {
  display: none !important;
}

.navbar-actions,
.top-navbar {
  overflow: visible;
}

.gsc-launcher-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  inset-inline-end: 0;
  width: min(22rem, 90vw);
  max-height: 24rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface-card, #fff);
  border: 1px solid var(--surface-border, #e2e8f0);
  border-radius: 0.75rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  z-index: 1085;
}

.gsc-launcher-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem 0.45rem;
}

.gsc-launcher-search {
  padding: 0 0.85rem 0.5rem;
}

.gsc-launcher-search input {
  width: 100%;
  border: 1px solid var(--surface-border, #e2e8f0);
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
}

.gsc-launcher-list {
  overflow-y: auto;
  min-height: 6rem;
  max-height: 14rem;
}

.gsc-launcher-item {
  display: flex;
  width: 100%;
  text-align: start;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.85rem;
  gap: 0.5rem;
  cursor: pointer;
  color: inherit;
}

.gsc-launcher-item:hover {
  background: rgba(37, 99, 235, 0.06);
}

.gsc-launcher-item-main {
  flex: 1;
  min-width: 0;
}

.gsc-launcher-item-title {
  font-weight: 600;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gsc-launcher-item-meta {
  font-size: 0.75rem;
  color: var(--text-secondary, #64748b);
}

.gsc-launcher-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.7rem 0.6rem;
  gap: 0.4rem;
}

.gsc-stage {
  position: fixed;
  inset-inline-end: 1rem;
  bottom: 0.75rem;
  z-index: 1048;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
  max-width: calc(100vw - 2rem);
}

.gsc-windows {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 0.65rem;
  pointer-events: none;
}

.gsc-window {
  pointer-events: auto;
  width: min(22.5rem, 92vw);
  height: min(32rem, calc(100dvh - 8.5rem));
  background: var(--surface-card, #fff);
  border: 1px solid var(--surface-border, #e2e8f0);
  border-radius: 0.85rem 0.85rem 0 0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gsc-window.is-focus {
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.22);
}

.gsc-window-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
  background: linear-gradient(160deg, #1d4ed8, #1e3a8a);
  color: #fff;
}

.gsc-window-head-main {
  min-width: 0;
  flex: 1 1 auto;
}

.gsc-window-title {
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gsc-window-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-block-start: 0.2rem;
}

.gsc-ticket-no {
  font-size: 0.72rem;
  opacity: 0.88;
}

.gsc-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.gsc-status-badge.is-open {
  background: rgba(34, 197, 94, 0.28);
}

.gsc-status-badge.is-closed {
  background: rgba(248, 113, 113, 0.32);
}

.gsc-window-meta {
  font-size: 0.72rem;
  opacity: 0.85;
  margin-block-start: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gsc-window-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.15rem;
}

.gsc-icon-btn {
  border: 0;
  background: transparent;
  color: #fff;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.35rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gsc-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.gsc-window-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}

.gsc-window-body .aw-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.7rem;
  min-height: 10rem;
}

.gsc-window-closed {
  margin: 0 0.7rem 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.82rem;
  line-height: 1.45;
}

.gsc-window-closed-title {
  font-weight: 650;
}

.gsc-window-closed-help {
  margin-block-start: 0.15rem;
}

.gsc-window-rating {
  margin: 0 0.7rem 0.45rem;
  font-size: 0.8rem;
  color: #64748b;
}

.gsc-window-composer {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem 0.7rem;
  background: #fff;
  border-block-start: 1px solid var(--surface-border, #e2e8f0);
}

.gsc-window-composer textarea {
  resize: none;
  min-height: 2.5rem;
  max-height: 6rem;
}

.gsc-window-composer-row {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: center;
}

.gsc-dock {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  max-width: min(70vw, 48rem);
}

.gsc-dock-item {
  border: 1px solid var(--surface-border, #e2e8f0);
  background: #fff;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 12rem;
}

.gsc-dock-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gsc-dock-item.is-closed {
  opacity: 0.8;
}

.gsc-dock-unread {
  background: #dc2626;
  color: #fff;
  border-radius: 999px;
  min-width: 1.1rem;
  padding: 0 0.28rem;
  font-size: 0.7rem;
  text-align: center;
  flex-shrink: 0;
}

.gsc-btn-sending,
.gsc-btn-sending:disabled {
  opacity: 0.75;
  pointer-events: none;
}

@media (max-width: 1199.98px) {
  .gsc-window {
    width: min(20rem, 92vw);
  }
}

@media (max-width: 767.98px) {
  .gsc-stage {
    inset-inline: 0.5rem;
    bottom: 0;
  }

  .gsc-window {
    width: 100%;
    height: min(70dvh, 28rem);
  }
}
