/* Paikmal Group Chat — public page */

/* Footer includes a fixed donate FAB site-wide; hide it here so it does not cover the composer */
body.group-chat-app .floating-donate-btn,
body.group-chat-app .site-footer-modern {
  display: none !important;
}

.group-chat-page {
  min-height: calc(100vh - 96px);
  padding: 10px 0 20px;
  background: linear-gradient(165deg, #f8fafc 0%, #eef2ff 45%, #f0fdfa 100%);
}

[data-theme="dark"] .group-chat-page {
  background: linear-gradient(165deg, #0f172a 0%, #1e1b4b 40%, #0f172a 100%);
}

.gc-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 12px;
}

.gc-pwa-install-modal .modal-dialog {
  max-width: 420px;
}

.gc-pwa-install-modal__content {
  border: none;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.gc-pwa-install-modal__header {
  background: linear-gradient(125deg, #4338ca, #6366f1 55%, #7c3aed);
  padding: 1rem 1.1rem;
  flex-wrap: nowrap;
  gap: 0.75rem;
}

.gc-pwa-install-modal__title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.gc-pwa-install-modal__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #fff;
}

.gc-pwa-install-modal__body {
  padding: 1.15rem 1.25rem 1rem;
  background: var(--card-bg, #fff);
  color: var(--body-color, #334155);
}

[data-theme="dark"] .gc-pwa-install-modal__body {
  background: #1e293b;
  color: #e2e8f0;
}

.gc-pwa-install-modal__lead {
  font-size: 0.9375rem;
  line-height: 1.45;
  font-weight: 500;
}

.gc-pwa-install-modal__lead[hidden] {
  display: none !important;
}

.gc-pwa-install-modal__footer {
  background: var(--card-bg, #fff);
  padding: 0 1.25rem 1.15rem;
  justify-content: space-between;
  align-items: center;
}

[data-theme="dark"] .gc-pwa-install-modal__footer {
  background: #1e293b;
}

.gc-pwa-install-dismiss {
  color: #6366f1 !important;
  text-decoration: none;
  font-weight: 600;
}

.gc-pwa-install-dismiss:hover {
  color: #4f46e5 !important;
  text-decoration: underline;
}

[data-theme="dark"] .gc-pwa-install-dismiss {
  color: #a5b4fc !important;
}

.gc-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--body-color, #334155);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

[data-theme="dark"] .gc-notice {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(165, 180, 252, 0.25);
  color: #e2e8f0;
}

.gc-notice i {
  color: #6366f1;
  margin-top: 2px;
}

.gc-shell {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--card-border, #e2e8f0);
  background: var(--card-bg, #fff);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  display: flex;
  flex-direction: column;
  min-height: min(680px, calc(100dvh - 140px));
  max-height: min(92dvh, 920px);
}

.gc-messages-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.gc-jump-latest {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  z-index: 6;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.gc-jump-latest.gc-jump-latest--visible {
  display: inline-flex;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.gc-jump-latest:hover,
.gc-jump-latest:focus-visible {
  filter: brightness(1.06);
  outline: none;
}

.gc-jump-latest i {
  font-size: 1rem;
}

[data-theme="dark"] .gc-jump-latest {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .gc-shell {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  border-color: #334155;
}

.gc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border, #e2e8f0);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.6));
}

[data-theme="dark"] .gc-toolbar {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.8));
  border-color: #334155;
}

.gc-room-title {
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--body-color, #1e293b);
}

.gc-room-title i {
  color: #6366f1;
}

.gc-status {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}

.gc-status.is-live {
  background: #ecfdf5;
  color: #047857;
}

.gc-status.is-offline {
  background: #fef3c7;
  color: #b45309;
}

[data-theme="dark"] .gc-status {
  background: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .gc-status.is-live {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.gc-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.35), transparent 120px);
}

[data-theme="dark"] .gc-messages {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.5), transparent 120px);
}

.gc-load-more {
  text-align: center;
  margin-bottom: 12px;
}

.gc-load-more button {
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px dashed var(--card-border, #cbd5e1);
  background: transparent;
  color: #6366f1;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.gc-load-more button:hover {
  background: rgba(99, 102, 241, 0.08);
}

.gc-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted-color, #94a3b8);
}

.gc-empty i {
  font-size: 3rem;
  opacity: 0.35;
  display: block;
  margin-bottom: 12px;
}

.gc-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: flex-end;
  contain: layout style;
  content-visibility: auto;
  contain-intrinsic-size: auto 72px;
}

.gc-row.is-me {
  flex-direction: row-reverse;
}

.gc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.gc-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  align-self: flex-end;
}

.gc-verified-badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border: 2px solid var(--card-bg, #fff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  z-index: 2;
  pointer-events: none;
}

.gc-verified-badge i {
  font-size: 10px;
  line-height: 1;
}

[data-theme="dark"] .gc-verified-badge {
  border-color: #1e293b;
}

.gc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gc-bubble {
  width: 100%;
  padding: 10px 14px 12px;
  border-radius: 16px 16px 16px 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.gc-row.is-me .gc-bubble {
  border-radius: 16px 16px 6px 16px;
  background: linear-gradient(145deg, #4f46e5, #6366f1);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}

[data-theme="dark"] .gc-bubble {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

[data-theme="dark"] .gc-row.is-me .gc-bubble {
  background: linear-gradient(145deg, #4338ca, #6366f1);
  color: #fff;
}

.gc-meta {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gc-meta-time {
  cursor: help;
  border-bottom: 1px dotted transparent;
  text-transform: none;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.gc-meta-time:hover {
  border-bottom-color: currentColor;
  opacity: 1;
}

.gc-row.is-me .gc-meta {
  justify-content: flex-end;
  color: rgba(255, 255, 255, 0.85);
}

.gc-body {
  font-size: 0.9375rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.gc-msg-col {
  flex: 1;
  min-width: 0;
  max-width: min(78%, 520px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.gc-row.is-me .gc-msg-col {
  align-items: flex-end;
}

.gc-msg-link {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.gc-row.is-me .gc-msg-link {
  color: #e0e7ff;
}

[data-theme="dark"] .gc-row:not(.is-me) .gc-msg-link {
  color: #93c5fd;
}

[data-theme="dark"] .gc-row.is-me .gc-msg-link {
  color: #e0e7ff;
}

.gc-msg-previews {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gc-link-preview {
  display: block;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.15s ease, transform 0.12s ease;
}

.gc-link-preview:hover {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}

.gc-link-preview--loading {
  min-height: 72px;
}

.gc-link-preview__inner {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 72px;
}

.gc-link-preview__inner--loading {
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.gc-link-preview__shimmer {
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 45%, #e2e8f0 90%);
  background-size: 200% 100%;
  animation: gc-lp-shimmer 1.1s ease-in-out infinite;
}

@keyframes gc-lp-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.gc-link-preview__img {
  width: 88px;
  min-width: 88px;
  height: auto;
  min-height: 72px;
  max-height: 120px;
  object-fit: cover;
  flex-shrink: 0;
}

.gc-link-preview__text {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.gc-link-preview__host {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.gc-link-preview__title {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gc-link-preview__desc {
  font-size: 0.72rem;
  line-height: 1.35;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gc-link-preview__inner--minimal {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: auto;
}

.gc-link-preview__inner--minimal .bi {
  font-size: 1.1rem;
  color: #6366f1;
  flex-shrink: 0;
}

.gc-link-preview__fallback {
  font-size: 0.78rem;
  word-break: break-all;
  color: #334155;
}

/* Link previews always use the light “card” palette so host/title/description stay
   readable. (Own-message bubble uses light text; forcing white on the preview broke contrast.) */

[data-theme="dark"] .gc-link-preview {
  border-color: #334155;
  background: #0f172a;
  color: #e2e8f0;
}

[data-theme="dark"] .gc-link-preview__title {
  color: #f1f5f9;
}

[data-theme="dark"] .gc-link-preview__host {
  color: #94a3b8;
}

[data-theme="dark"] .gc-link-preview__desc {
  color: #cbd5e1;
}

[data-theme="dark"] .gc-link-preview__fallback {
  color: #e2e8f0;
}

[data-theme="dark"] .gc-row.is-me .gc-link-preview {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(255, 255, 255, 0.22);
}

.gc-composer-wrap {
  border-top: 1px solid var(--card-border, #e2e8f0);
  padding: 14px 16px 16px;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .gc-composer-wrap {
  background: rgba(15, 23, 42, 0.9);
  border-color: #334155;
}

.gc-login-cta {
  text-align: center;
  padding: 16px;
}

.gc-login-cta p {
  margin: 0 0 10px;
  color: var(--muted-color, #64748b);
  font-size: 0.9rem;
}

.gc-login-cta .btn-primary {
  border-radius: 999px;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  border: none;
}

.gc-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.gc-input-shell {
  flex: 1;
  min-width: 0;
  position: relative;
}

.gc-input-shell .gc-input {
  width: 100%;
}

.gc-emoji-toggle {
  position: absolute;
  right: 8px;
  bottom: 7px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #64748b;
  background: rgba(148, 163, 184, 0.16);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.gc-emoji-toggle:hover,
.gc-emoji-toggle:focus-visible {
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.2);
  outline: none;
}

.gc-emoji-toggle:active {
  transform: scale(0.94);
}

[data-theme="dark"] .gc-emoji-toggle {
  color: #94a3b8;
  background: rgba(71, 85, 105, 0.35);
}

[data-theme="dark"] .gc-emoji-toggle:hover,
[data-theme="dark"] .gc-emoji-toggle:focus-visible {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.28);
}

.gc-emoji-panel {
  position: fixed;
  z-index: 2147483001;
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 20px));
  height: min(300px, 46vh);
  max-height: 320px;
  border-radius: 16px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #e2e8f0);
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.gc-emoji-panel.gc-emoji-panel--open {
  display: flex;
}

.gc-emoji-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 8px 6px;
  border-bottom: 1px solid var(--card-border, #e2e8f0);
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.gc-emoji-tab {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-color, #64748b);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.gc-emoji-tab:hover,
.gc-emoji-tab:focus-visible {
  color: #4f46e5;
  outline: none;
}

.gc-emoji-tab.gc-emoji-tab--active {
  color: #4f46e5;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(139, 92, 246, 0.14));
}

[data-theme="dark"] .gc-emoji-tab {
  color: #94a3b8;
}

[data-theme="dark"] .gc-emoji-tab:hover,
[data-theme="dark"] .gc-emoji-tab:focus-visible {
  color: #c7d2fe;
}

[data-theme="dark"] .gc-emoji-tab.gc-emoji-tab--active {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.28);
}

.gc-emoji-panes {
  flex: 1;
  position: relative;
  min-height: 0;
}

.gc-emoji-pane {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 10px 8px 12px;
  display: none;
  -webkit-overflow-scrolling: touch;
}

.gc-emoji-pane.gc-emoji-pane--active {
  display: block;
}

.gc-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}

.gc-emoji-cell {
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 1.35rem;
  line-height: 1.25;
  padding: 7px 2px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.1s ease;
}

.gc-emoji-cell:hover,
.gc-emoji-cell:focus-visible {
  background: rgba(99, 102, 241, 0.12);
  outline: none;
}

.gc-emoji-cell:active {
  transform: scale(0.92);
}

[data-theme="dark"] .gc-emoji-panel {
  border-color: #334155;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .gc-emoji-tabs {
  border-color: #334155;
}

[data-theme="dark"] .gc-emoji-cell:hover,
[data-theme="dark"] .gc-emoji-cell:focus-visible {
  background: rgba(129, 140, 248, 0.18);
}

.gc-emoji-empty {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted-color, #64748b);
  padding: 28px 16px;
}

.gc-input {
  flex: 1;
  border-radius: 14px !important;
  border: 1px solid var(--card-border, #e2e8f0) !important;
  padding: 12px 14px !important;
  font-size: 0.9375rem;
  resize: none;
  min-height: 48px;
  max-height: 120px;
  background: var(--card-bg, #fff) !important;
  color: var(--body-color, #1e293b) !important;
}

[data-theme="dark"] .gc-input {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #f1f5f9 !important;
}

.gc-input-shell .gc-input {
  padding-right: 48px !important;
}

.gc-send {
  border-radius: 14px !important;
  padding: 12px 18px !important;
  font-weight: 600;
  background: linear-gradient(135deg, #059669, #10b981) !important;
  border: none !important;
}

.gc-send:disabled {
  opacity: 0.55;
}

.gc-send-label {
  margin-left: 0.35rem;
}

.gc-err {
  font-size: 0.8125rem;
  color: #b91c1c;
  margin-top: 6px;
}

[data-theme="dark"] .gc-err {
  color: #fca5a5;
}

/* Admin / journalist: delete via right-click / long-press */
.group-chat-moderator .gc-row-admin {
  cursor: context-menu;
  -webkit-touch-callout: none;
}

.gc-ctx-menu {
  position: fixed;
  z-index: 2147483000;
  min-width: 180px;
  padding: 6px;
  border-radius: 12px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #e2e8f0);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
  display: none;
  opacity: 0;
  pointer-events: none;
}

.gc-ctx-menu.gc-ctx-menu--open {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

[data-theme="dark"] .gc-ctx-menu {
  background: #1e293b;
  border-color: #334155;
}

.gc-ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #b91c1c;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.gc-ctx-item:hover {
  background: rgba(220, 38, 38, 0.08);
}

[data-theme="dark"] .gc-ctx-item {
  color: #fca5a5;
}

[data-theme="dark"] .gc-ctx-item:hover {
  background: rgba(248, 113, 113, 0.12);
}

@media (max-width: 576px) {
  .group-chat-page {
    min-height: calc(100dvh - 72px);
    padding: 6px 0 12px;
  }

  .gc-wrap {
    padding: 0 8px;
  }

  .gc-shell {
    min-height: calc(100dvh - 88px);
    max-height: calc(100dvh - 88px);
    border-radius: 14px;
  }

  .gc-bubble {
    max-width: 88%;
  }
}

.gc-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.gc-presence {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted-color, #64748b);
  white-space: nowrap;
}

.gc-search {
  display: flex;
  align-items: center;
  min-width: 160px;
  max-width: 260px;
  flex: 1 1 180px;
  height: 34px;
  border: 1px solid var(--card-border, #e2e8f0);
  border-radius: 999px;
  background: var(--card-bg, #fff);
  overflow: hidden;
}

.gc-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 8px 0 12px;
  font-size: 0.85rem;
  color: var(--body-color, #1e293b);
}

.gc-search-btn,
.gc-search-clear,
.gc-msg-action,
.gc-reply-box button {
  border: 0;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gc-search-btn,
.gc-search-clear {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.gc-msg-action {
  width: 30px;
  height: 26px;
  margin-left: auto;
  border-radius: 999px;
  color: inherit;
  opacity: 0.78;
}

.gc-msg-action:hover,
.gc-msg-action:focus-visible {
  background: rgba(100, 116, 139, 0.14);
  outline: none;
  opacity: 1;
}

.gc-reply-ref {
  width: 100%;
  border: 0;
  border-left: 3px solid rgba(99, 102, 241, 0.55);
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
  padding: 7px 9px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.gc-reply-ref strong,
.gc-reply-ref span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-reply-ref strong {
  font-size: 0.74rem;
}

.gc-reply-ref span {
  font-size: 0.8rem;
  opacity: 0.82;
}

.gc-reply-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--body-color, #1e293b);
  font-size: 0.86rem;
}

.gc-reply-box[hidden] {
  display: none !important;
}

.gc-reply-box div {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-reply-box button {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.gc-typing {
  min-height: 18px;
  margin-bottom: 5px;
  color: var(--muted-color, #64748b);
  font-size: 0.78rem;
  font-weight: 600;
}

.gc-edited {
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.85;
}

[data-theme="dark"] .gc-search {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .gc-search-input,
[data-theme="dark"] .gc-reply-box {
  color: #e2e8f0;
}

[data-theme="dark"] .gc-reply-box,
[data-theme="dark"] .gc-reply-ref {
  background: rgba(99, 102, 241, 0.18);
}

@supports (height: 100svh) {
  .gc-shell {
    min-height: min(680px, calc(100svh - 140px));
    max-height: min(92svh, 920px);
  }
}

@media (max-width: 576px) {
  .gc-wrap {
    padding: 0;
  }

  .gc-shell {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .gc-toolbar {
    padding: 10px 10px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .gc-room-title {
    flex: 1 1 auto;
    min-width: 170px;
  }

  .gc-toolbar-actions {
    order: 2;
    width: 100%;
    flex: 1 0 100%;
  }

  .gc-search {
    max-width: none;
    min-width: 0;
  }

  .gc-presence {
    display: none;
  }

  .gc-messages {
    padding: 12px 10px;
  }

  .gc-row {
    gap: 7px;
    margin-bottom: 12px;
  }

  .gc-avatar,
  .gc-avatar-wrap {
    width: 32px;
    height: 32px;
  }

  .gc-msg-col {
    max-width: min(89%, 520px);
  }

  .gc-bubble {
    max-width: 100%;
    padding: 9px 11px 10px;
    border-radius: 14px 14px 14px 5px;
  }

  .gc-row.is-me .gc-bubble {
    border-radius: 14px 14px 5px 14px;
  }

  .gc-meta {
    gap: 5px;
    flex-wrap: wrap;
  }

  .gc-composer-wrap {
    padding: 10px max(10px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .gc-form {
    gap: 8px;
  }

  .gc-input {
    min-height: 46px;
    max-height: 140px;
    font-size: 16px;
  }

  .gc-send {
    width: 46px;
    height: 46px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .gc-send-label {
    display: none;
  }

  .gc-emoji-toggle {
    width: 40px;
    height: 40px;
    right: 5px;
    bottom: 3px;
  }

  .gc-emoji-panel {
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: min(390px, 58svh);
    max-height: none;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .gc-emoji-grid {
    grid-template-columns: repeat(7, 1fr);
  }
}

/* Emoji picker: keep composer visible and show all categories in one scrollable tray. */
.gc-composer-wrap .gc-emoji-panel {
  position: relative;
  z-index: 4;
  display: none;
  width: 100%;
  height: min(260px, 34dvh);
  max-height: 300px;
  margin: 0 0 10px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.gc-composer-wrap .gc-emoji-panel.gc-emoji-panel--open {
  display: flex;
}

.gc-emoji-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 8px 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.gc-emoji-section {
  scroll-margin-top: 10px;
  padding: 2px 0 12px;
}

.gc-emoji-section + .gc-emoji-section {
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  padding-top: 10px;
}

.gc-emoji-section-title {
  position: sticky;
  top: -8px;
  z-index: 1;
  margin: -2px -2px 6px;
  padding: 7px 4px 5px;
  background: var(--card-bg, #fff);
  color: var(--muted-color, #64748b);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gc-emoji-empty {
  padding: 8px 8px 10px;
}

[data-theme="dark"] .gc-emoji-section-title {
  background: var(--card-bg, #1e293b);
}

[data-theme="dark"] .gc-emoji-section + .gc-emoji-section {
  border-top-color: rgba(148, 163, 184, 0.18);
}

@media (max-width: 576px) {
  .gc-composer-wrap .gc-emoji-panel {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: min(230px, 32svh);
    max-height: 260px;
    border-radius: 14px;
    padding-bottom: 0;
    margin-bottom: 8px;
  }

  .gc-emoji-tabs {
    padding: 7px 7px 5px;
  }

  .gc-emoji-tab {
    padding: 6px 10px;
    font-size: 0.66rem;
  }

  .gc-emoji-scroll {
    padding: 6px 7px 10px;
  }

  .gc-emoji-cell {
    min-height: 40px;
    font-size: 1.42rem;
    padding: 5px 1px;
  }
}

/* Collapsible chat search: icon by default, full input only while searching. */
.gc-search-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--card-border, #e2e8f0);
  border-radius: 999px;
  background: var(--card-bg, #fff);
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.gc-search-toggle:hover,
.gc-search-toggle:focus-visible,
.gc-search-toggle[aria-expanded="true"] {
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.08);
  outline: none;
}

.gc-toolbar-actions .gc-search {
  order: 5;
  flex: 1 0 100%;
  width: 100%;
  max-width: none;
  min-width: 0;
  display: none;
  margin-top: 2px;
}

.gc-toolbar-actions .gc-search.gc-search--open {
  display: flex;
}

[data-theme="dark"] .gc-search-toggle {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .gc-search-toggle:hover,
[data-theme="dark"] .gc-search-toggle:focus-visible,
[data-theme="dark"] .gc-search-toggle[aria-expanded="true"] {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.18);
}

@media (max-width: 576px) {
  .gc-toolbar {
    align-items: center;
  }

  .gc-room-title {
    min-width: 0;
  }

  .gc-toolbar-actions {
    order: 0;
    width: auto;
    flex: 0 0 auto;
  }

  .gc-toolbar-actions .gc-search {
    position: absolute;
    left: 10px;
    right: 10px;
    top: calc(100% - 4px);
    z-index: 8;
    width: auto;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
  }

  .gc-toolbar {
    position: relative;
  }
}

.gc-info-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--card-border, #e2e8f0);
  border-radius: 999px;
  background: var(--card-bg, #fff);
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.gc-info-toggle:hover,
.gc-info-toggle:focus-visible,
.gc-info-toggle[aria-expanded="true"] {
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.08);
  outline: none;
}

.gc-info-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 12px;
  z-index: 20;
  display: none;
  width: min(360px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--card-border, #e2e8f0);
  border-radius: 14px;
  background: var(--card-bg, #fff);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}

.gc-info-panel.gc-info-panel--open {
  display: block;
}

.gc-info-grid {
  display: grid;
  gap: 9px;
}

.gc-info-grid > div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.1);
}

.gc-info-grid span,
.gc-info-grid small {
  display: block;
  color: var(--muted-color, #64748b);
  font-size: 0.72rem;
  line-height: 1.35;
}

.gc-info-grid strong {
  display: block;
  margin-top: 2px;
  color: var(--body-color, #1e293b);
  font-size: 0.9rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-clear-chat {
  width: 100%;
  margin-top: 10px;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.gc-clear-chat:hover,
.gc-clear-chat:focus-visible {
  background: #fecaca;
  outline: none;
}

.gc-clear-chat:disabled {
  opacity: 0.6;
  cursor: wait;
}

[data-theme="dark"] .gc-info-toggle {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .gc-info-toggle:hover,
[data-theme="dark"] .gc-info-toggle:focus-visible,
[data-theme="dark"] .gc-info-toggle[aria-expanded="true"] {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.18);
}

[data-theme="dark"] .gc-info-panel {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

[data-theme="dark"] .gc-info-grid > div {
  background: rgba(15, 23, 42, 0.45);
}

[data-theme="dark"] .gc-info-grid strong {
  color: #e2e8f0;
}

[data-theme="dark"] .gc-clear-chat {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
}

@media (max-width: 576px) {
  .gc-info-panel {
    right: 10px;
    left: 10px;
    top: calc(100% + 8px);
    width: auto;
  }
}

.gc-toolbar {
  position: relative;
}

.gc-reports-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.gc-reports-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted-color, #64748b);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gc-reports-title strong {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  font-size: 0.78rem;
}

.gc-reports-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.gc-reports-list--empty {
  color: var(--muted-color, #64748b);
  font-size: 0.82rem;
  padding: 6px 2px;
}

.gc-report-item {
  padding: 9px;
  border-radius: 10px;
  background: rgba(254, 226, 226, 0.65);
}

.gc-report-body {
  color: var(--body-color, #1e293b);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gc-report-meta {
  margin-top: 4px;
  color: #7f1d1d;
  font-size: 0.72rem;
  line-height: 1.35;
}

.gc-report-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.gc-report-actions button {
  flex: 1;
  border: 0;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.gc-report-actions [data-report-action="remove"] {
  background: #dc2626;
  color: #fff;
}

.gc-report-actions [data-report-action="dismiss"] {
  background: rgba(100, 116, 139, 0.14);
  color: #334155;
}

[data-theme="dark"] .gc-reports-panel {
  border-top-color: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .gc-reports-title strong {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
}

[data-theme="dark"] .gc-report-item {
  background: rgba(127, 29, 29, 0.28);
}

[data-theme="dark"] .gc-report-body {
  color: #e2e8f0;
}

[data-theme="dark"] .gc-report-meta {
  color: #fecaca;
}

[data-theme="dark"] .gc-report-actions [data-report-action="dismiss"] {
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
}

/* Cleaner author avatar badges */
.gc-avatar-wrap {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.gc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--card-bg, #fff);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
}

.gc-row.is-me .gc-avatar {
  border-color: #eef2ff;
}

.gc-verified-badge {
  right: -1px;
  bottom: -1px;
  width: 15px;
  height: 15px;
  border-width: 2px;
  background: #2563eb;
  box-shadow: 0 2px 7px rgba(37, 99, 235, 0.28);
}

.gc-verified-badge i {
  font-size: 8px;
}

.gc-online-badge {
  position: absolute;
  left: -1px;
  bottom: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--card-bg, #fff);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.14);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.gc-row.is-online .gc-online-badge {
  opacity: 1;
  transform: scale(1);
}

[data-theme="dark"] .gc-avatar,
[data-theme="dark"] .gc-online-badge {
  border-color: #1e293b;
}

[data-theme="dark"] .gc-row.is-me .gc-avatar {
  border-color: #312e81;
}

@media (max-width: 576px) {
  .gc-avatar-wrap {
    width: 34px;
    height: 34px;
  }

  .gc-avatar {
    width: 31px;
    height: 31px;
  }

  .gc-verified-badge {
    width: 14px;
    height: 14px;
  }

  .gc-online-badge {
    width: 10px;
    height: 10px;
  }
}

/* Minimal document for iframe embed (site widget) */
html.group-chat-embed-root,
body.group-chat-embed {
  height: 100%;
  margin: 0;
}

body.group-chat-embed {
  overflow: hidden;
}

body.group-chat-embed .group-chat-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 4px 0 8px;
  box-sizing: border-box;
}

body.group-chat-embed .gc-wrap {
  max-width: none;
  height: 100%;
  padding: 0 6px;
  display: flex;
  flex-direction: column;
}

body.group-chat-embed .gc-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.group-chat-embed .gc-messages-wrap {
  flex: 1;
  min-height: 0;
}

body.group-chat-embed .gc-toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gc-embed-fullpage {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #4f46e5;
  text-decoration: none;
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
  margin-right: 0.25rem;
  white-space: nowrap;
}

.gc-embed-fullpage:hover {
  background: rgba(79, 70, 229, 0.1);
  color: #4338ca;
}

[data-theme="dark"] .gc-embed-fullpage {
  color: #a5b4fc;
}

[data-theme="dark"] .gc-embed-fullpage:hover {
  background: rgba(165, 180, 252, 0.12);
  color: #c7d2fe;
}
