/* ================================================================
   CHATG.CSS — Estilos independientes ChatG v1.0
   Identidad visual Globalink: gradientes, glassmorphism, Outfit
================================================================ */

/* ── Tokens ──────────────────────────────────────────────────── */
:root, :host {
  --cg-bg:        #07070f;
  --cg-bg2:       #0d0d1a;
  --cg-bg3:       #13132a;
  --cg-card:      rgba(255,255,255,.04);
  --cg-border:    rgba(255,255,255,.07);
  --cg-primary:   #c639b8;
  --cg-secondary: #1e8ee9;
  --cg-grad:      linear-gradient(135deg,#c639b8,#1e8ee9);
  --cg-grad-soft: linear-gradient(135deg,rgba(198,57,184,.15),rgba(30,142,233,.10));
  --cg-text:      rgba(255,255,255,.92);
  --cg-muted:     rgba(255,255,255,.45);
  --cg-muted2:    rgba(255,255,255,.25);
  --cg-online:    #22c55e;
  --cg-danger:    #ef4444;
  --cg-radius:    16px;
  --cg-nav-h:     64px;
  --cg-header-h:  56px;
  --cg-font:      'Outfit', sans-serif;
  --cg-blur:      blur(20px);
  --cg-shadow:    0 8px 32px rgba(0,0,0,.45);
}

/* ── Reset ───────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html,body { height:100%; overflow:hidden; font-family:var(--cg-font); background:var(--cg-bg); color:var(--cg-text); -webkit-tap-highlight-color:transparent; }
input,textarea,button { font-family:var(--cg-font); outline:none; }
button { cursor:pointer; border:none; background:none; color:inherit; }
img { max-width:100%; }

/* ── Splash ──────────────────────────────────────────────────── */
#cgSplash {
  position:fixed; inset:0; z-index:9999;
  background:var(--cg-bg);
  display:flex; align-items:center; justify-content:center;
}
.cg-splash-inner { text-align:center; display:flex; flex-direction:column; align-items:center; gap:12px; }
.cg-splash-logo  { width:72px; height:72px; border-radius:20px; object-fit:cover; }
.cg-splash-title { font-size:32px; font-weight:800; background:var(--cg-grad); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.cg-splash-sub   { font-size:13px; color:var(--cg-muted); }
.cg-splash-spinner { display:flex; gap:6px; margin-top:8px; }
.cg-splash-spinner div { width:8px; height:8px; border-radius:50%; background:var(--cg-primary); animation:cgPulse 1.2s ease-in-out infinite; }
.cg-splash-spinner div:nth-child(2) { animation-delay:.2s; background:var(--cg-secondary); }
.cg-splash-spinner div:nth-child(3) { animation-delay:.4s; }
@keyframes cgPulse { 0%,80%,100%{transform:scale(.6);opacity:.4} 40%{transform:scale(1);opacity:1} }

/* ── Auth ────────────────────────────────────────────────────── */
#cgLogin {
  position:fixed; inset:0; overflow-y:auto;
  background:radial-gradient(ellipse at 30% 20%,rgba(198,57,184,.15) 0%,transparent 60%),
             radial-gradient(ellipse at 70% 80%,rgba(30,142,233,.12) 0%,transparent 60%),
             var(--cg-bg);
  display:flex; align-items:center; justify-content:center; padding:20px;
}
.cg-auth-wrap { width:100%; max-width:400px; }
.cg-auth-logo { text-align:center; margin-bottom:28px; }
.cg-auth-logo img { width:60px; height:60px; border-radius:16px; margin-bottom:10px; }
.cg-auth-logo h1 { font-size:26px; font-weight:800; background:var(--cg-grad); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.cg-auth-logo p  { font-size:13px; color:var(--cg-muted); margin-top:4px; }
.cg-login-version { display:block; margin-top:6px; color:var(--cg-muted); font-size:12px; font-weight:600; }
.cg-auth-card { background:rgba(255,255,255,.04); border:1px solid var(--cg-border); border-radius:22px; padding:24px; backdrop-filter:var(--cg-blur); }
.cg-auth-card h2 { font-size:18px; font-weight:700; margin-bottom:20px; }
.cg-auth-divider { display:flex; align-items:center; gap:12px; margin:16px 0; }
.cg-auth-divider::before,.cg-auth-divider::after { content:''; flex:1; height:1px; background:var(--cg-border); }
.cg-auth-divider span { font-size:12px; color:var(--cg-muted); }
.cg-auth-footer { text-align:center; margin-top:16px; font-size:13px; color:var(--cg-muted); }
.cg-auth-footer a { color:var(--cg-primary); text-decoration:none; font-weight:600; }
.cg-2fa-icon { font-size:40px; text-align:center; margin-bottom:8px; }
.cg-totp-input { text-align:center; font-size:28px; font-weight:700; letter-spacing:10px; }

/* ── Inputs y botones globales ───────────────────────────────── */
.cg-field { margin-bottom:14px; }
.cg-field label { display:block; font-size:11px; font-weight:600; color:var(--cg-muted); text-transform:uppercase; letter-spacing:.5px; margin-bottom:5px; }
.cg-input {
  width:100%; padding:11px 14px;
  background:rgba(255,255,255,.06); border:1.5px solid var(--cg-border);
  border-radius:12px; color:var(--cg-text); font-size:14px; transition:border-color .15s;
}
.cg-input:focus { border-color:var(--cg-primary); }
.cg-pass-toggle { position:absolute; right:12px; top:50%; transform:translateY(-50%); color:var(--cg-muted); font-size:15px; background:none; border:none; cursor:pointer; }
.cg-btn-primary {
  width:100%; padding:13px; border-radius:14px; font-size:14px; font-weight:700;
  background:var(--cg-grad); color:#fff; display:flex; align-items:center; justify-content:center; gap:8px;
  transition:opacity .15s; margin-top:4px;
}
.cg-btn-primary:hover { opacity:.88; }
.cg-btn-primary:disabled { opacity:.5; cursor:not-allowed; }
.cg-btn-outline {
  width:100%; padding:12px; border-radius:14px; font-size:13px; font-weight:600;
  border:1.5px solid var(--cg-border); color:var(--cg-text);
  display:flex; align-items:center; justify-content:center; gap:8px;
  transition:.15s; background:rgba(255,255,255,.03);
}
.cg-btn-outline:hover { border-color:var(--cg-primary); color:var(--cg-primary); }
.cg-btn-ghost { width:100%; padding:10px; border-radius:12px; font-size:13px; color:var(--cg-muted); background:none; border:none; margin-top:8px; transition:color .15s; }
.cg-btn-ghost:hover { color:var(--cg-text); }
.cg-error { color:#ff5555; font-size:12px; padding:8px 12px; background:rgba(239,68,68,.1); border-radius:10px; margin-bottom:10px; }

/* ── App layout ──────────────────────────────────────────────── */
#cgApp { position:fixed; inset:0; display:flex; flex-direction:column; overflow:hidden; }

.cg-header {
  min-height:var(--cg-header-h); flex-shrink:0;
  display:flex; align-items:center; justify-content:space-between; padding:0 16px;
  background:rgba(7,7,15,.85); backdrop-filter:var(--cg-blur);
  border-bottom:1px solid var(--cg-border); z-index:100;
  padding-top:calc(env(safe-area-inset-top) + 10px);
  padding-bottom:10px;
}
.cg-header-left  { display:flex; align-items:center; min-width:0; gap:10px; }
.cg-header-brand { display:grid; min-width:0; gap:2px; }
.cg-header-brand .cg-header-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; line-height:1.2; }
.cg-header-version { color:var(--cg-muted); font-size:11px; font-weight:600; white-space:nowrap; }
.cg-header-logo  { width:28px; height:28px; border-radius:8px; object-fit:cover; }
.cg-header-title { font-size:17px; font-weight:700; background:var(--cg-grad); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.cg-header-right { display:flex; flex-shrink:0; gap:4px; }
.cg-icon-btn { width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:16px; color:var(--cg-muted); transition:.15s; }
.cg-icon-btn:hover { background:rgba(255,255,255,.08); color:var(--cg-text); }

.cg-main { flex:1; overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch; padding-bottom:calc(var(--cg-nav-h) + env(safe-area-inset-bottom)); }

/* ── Tab Chats — lista de threads ────────────────────────────── */
.cg-stories-row {
  display:flex; gap:10px; padding:14px 16px 10px;
  overflow-x:auto; scrollbar-width:none;
}
.cg-stories-row::-webkit-scrollbar { display:none; }
.cg-story-item { display:flex; flex-direction:column; align-items:center; gap:5px; cursor:pointer; flex-shrink:0; }
.cg-story-ring {
  width:52px; height:52px; border-radius:50%; padding:2.5px;
  background:var(--cg-grad); position:relative;
}
.cg-story-ring .cg-av { width:100%; height:100%; border-radius:50%; border:2.5px solid var(--cg-bg); overflow:hidden; background:var(--cg-bg3); display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:700; }
.cg-story-ring .cg-av img { width:100%; height:100%; object-fit:cover; }
.cg-story-name { font-size:10px; color:var(--cg-muted); max-width:54px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:center; }

.cg-section-label { font-size:11px; font-weight:700; color:var(--cg-muted); text-transform:uppercase; letter-spacing:1px; padding:8px 16px 4px; }

.cg-thread {
  display:flex; align-items:center; gap:12px; padding:11px 16px;
  cursor:pointer; transition:background .12s; position:relative;
}
.cg-thread:hover,.cg-thread:active { background:rgba(255,255,255,.04); }
.cg-thread.active { background:rgba(198,57,184,.08); }
.cg-thread-av { position:relative; flex-shrink:0; }
.cg-thread-av .cg-av { width:48px; height:48px; border-radius:50%; background:var(--cg-bg3); display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:700; overflow:hidden; }
.cg-thread-av .cg-av img { width:100%; height:100%; object-fit:cover; }
.cg-online-dot { position:absolute; bottom:1px; right:1px; width:12px; height:12px; border-radius:50%; background:var(--cg-online); border:2px solid var(--cg-bg); }
.cg-thread-info { flex:1; min-width:0; }
.cg-thread-name { font-size:14px; font-weight:600; color:var(--cg-text); margin-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cg-thread-preview { font-size:12px; color:var(--cg-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cg-thread-meta { display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex-shrink:0; }
.cg-thread-time { font-size:10px; color:var(--cg-muted2); }
.cg-thread-badge { min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:var(--cg-primary); color:#fff; font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.cg-typing-indicator { font-size:11px; color:var(--cg-primary); font-style:italic; }

/* ── Panel de conversación ───────────────────────────────────── */
.cg-conv-panel {
  position:fixed;
  top:0; left:0; right:0;
  /* bottom:0 — el nav se oculta al abrir chat (ver regla :has y .conv-open),
     el panel ocupa toda la pantalla verticalmente */
  bottom: 0;
  z-index:200;
  display:flex; flex-direction:column;
  background:var(--cg-bg);
  transform:translateX(100%); transition:transform .25s cubic-bezier(.4,0,.2,1);
}
.cg-conv-panel.open { transform:translateX(0); }

.cg-conv-header {
  min-height:var(--cg-header-h); flex-shrink:0;
  display:flex; align-items:center; gap:10px; padding:0 12px;
  background:rgba(7,7,15,.9); backdrop-filter:var(--cg-blur);
  border-bottom:1px solid var(--cg-border);
  padding-top:calc(env(safe-area-inset-top) + 8px);
  padding-bottom:8px;
}
.cg-conv-back { width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:18px; color:var(--cg-muted); }
.cg-conv-back:hover { background:rgba(255,255,255,.08); color:var(--cg-text); }
.cg-conv-info { flex:1; min-width:0; display:flex; align-items:center; gap:10px; cursor:pointer; }
.cg-conv-name { font-size:15px; font-weight:700; }
.cg-conv-status { font-size:11px; color:var(--cg-muted); }
.cg-conv-actions { display:flex; gap:2px; }

.cg-messages {
  flex:1; overflow-y:auto; padding:12px 14px;
  -webkit-overflow-scrolling:touch; scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.1) transparent;
  display:flex; flex-direction:column; gap:2px;
}

/* ── Burbujas ────────────────────────────────────────────────── */
.cg-bubble-wrap { display:flex; align-items:flex-end; gap:6px; margin-bottom:2px; }
.cg-bubble-wrap.me { flex-direction:row-reverse; }
.cg-bubble-wrap.them .cg-av { width:28px; height:28px; border-radius:50%; flex-shrink:0; background:var(--cg-bg3); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; overflow:hidden; }
.cg-bubble-wrap.them .cg-av img { width:100%; height:100%; object-fit:cover; }
.cg-bubble {
  /* FIX: sin overflow:hidden, el ancho mínimo automático de un item flex
     se calcula a partir del contenido (ver chatg.js: burbuja de ubicación
     con mapa Leaflet) — eso ignoraba max-width:72% y en pantallas angostas
     el mapa empujaba la burbuja fuera de la pantalla. overflow:hidden hace
     que el navegador respete max-width:72% como corresponde. */
  max-width:72%; padding:9px 13px; border-radius:18px; overflow:hidden;
  font-size:13.5px; line-height:1.45; position:relative; word-break:break-word;
}
.cg-bubble-wrap.me .cg-bubble { background:var(--cg-bubble-bg, var(--cg-grad)); color:#fff; border-bottom-right-radius:5px; }
.cg-bubble-wrap.them .cg-bubble { background:rgba(255,255,255,.08); color:var(--cg-text); border-bottom-left-radius:5px; border:1px solid var(--cg-border); }
.cg-bubble-time { display:flex; align-items:center; gap:3px; margin-top:3px; font-size:10px; opacity:.6; justify-content:flex-end; }
.cg-bubble-wrap.them .cg-bubble-time { justify-content:flex-start; }
.cg-deleted { font-style:italic; opacity:.4; font-size:12px; }
.cg-edited { font-size:10px; opacity:.5; }

/* ── Burbuja de imagen / video ───────────────────────────────── */
.cg-bubble-img { max-width:220px; border-radius:14px; cursor:pointer; display:block; }
.cg-bubble-video { max-width:220px; border-radius:14px; display:block; }

/* ── Burbuja de nota de voz ──────────────────────────────────── */
.cg-voice-bubble { display:flex; align-items:center; gap:10px; min-width:160px; }
.cg-voice-play { width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:rgba(255,255,255,.2); font-size:14px; flex-shrink:0; cursor:pointer; border:none; color:inherit; }
.cg-voice-dur  { font-size:11px; opacity:.65; white-space:nowrap; }

/* ── Reacciones ──────────────────────────────────────────────── */
.cg-reactions { display:flex; flex-wrap:wrap; gap:3px; margin-top:4px; }
.cg-react-chip { font-size:13px; padding:2px 7px; border-radius:12px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12); cursor:pointer; }
.cg-react-chip.mine { background:rgba(198,57,184,.2); border-color:rgba(198,57,184,.4); }

/* ── Reply banner ────────────────────────────────────────────── */
.cg-reply-banner {
  display:flex; align-items:center; gap:10px; padding:8px 14px;
  background:rgba(255,255,255,.04); border-top:1px solid var(--cg-border);
  flex-shrink:0;
}
.cg-reply-bar { width:3px; min-height:32px; background:var(--cg-grad); border-radius:2px; flex-shrink:0; }
.cg-reply-text { flex:1; font-size:12px; color:var(--cg-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cg-reply-close { color:var(--cg-muted); font-size:18px; }

/* ── Input area ──────────────────────────────────────────────── */
.cg-input-area {
  flex-shrink: 0;
  padding: 8px 10px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  background: rgba(7,7,15,.9);
  backdrop-filter: var(--cg-blur);
  border-top: 1px solid var(--cg-border);
}

/* Row: position:relative — contexto para todos los botones absolutos */
.cg-input-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  position: relative;
}

.cg-composer-field {
  display:flex;align-items:flex-end;gap:1px;flex:1;min-width:0;
  padding:1px 3px;border:1px solid #446c99;border-radius:19px;
  background:linear-gradient(145deg,#182f4e,#112039);
}
.cg-composer-field:focus-within { border-color:#7ee4ff; }
.cg-input-btn {
  display:grid;place-items:center;flex:none;width:40px;height:44px;
  padding:0;border:0;border-radius:13px;background:transparent;
  color:#b9dcf7;font-size:17px;cursor:pointer;touch-action:manipulation;
}
.cg-input-btn:hover { color:#e3f7ff;background:#254670; }
.cg-msg-input {
  flex:1;min-width:0;width:100%;min-height:44px;max-height:120px;
  padding:11px 2px 8px;box-sizing:border-box;
  resize:none;outline:none;border:0;background:transparent;color:#f4f9ff;
  font-family:inherit;line-height:1.4;
}
.cg-msg-input::placeholder { color:#adbed8;opacity:1; }

/* SEND */
.cg-send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--cg-grad);
  color: #fff;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, opacity .15s;
  border: none; cursor: pointer;
}
.cg-send-btn:hover { transform: scale(1.05); }
.cg-send-btn:disabled { opacity: .4; transform: none; }

/* ── Tab Contactos ───────────────────────────────────────────── */
.cg-search-bar {
  display:flex; align-items:center; gap:10px; padding:12px 16px;
  background:rgba(255,255,255,.03); border-bottom:1px solid var(--cg-border);
}
.cg-search-bar .cg-input { margin:0; border-radius:20px; padding:9px 14px; }
.cg-contact-item { display:flex; align-items:center; gap:12px; padding:11px 16px; cursor:pointer; transition:background .12s; }
.cg-contact-item:hover { background:rgba(255,255,255,.04); }
.cg-contact-info { flex:1; min-width:0; }
.cg-contact-name { font-size:14px; font-weight:600; }
.cg-contact-user { font-size:12px; color:var(--cg-muted); }
.cg-contact-action { padding:7px 14px; border-radius:20px; font-size:12px; font-weight:700; border:1.5px solid var(--cg-primary); color:var(--cg-primary); background:none; transition:.15s; }
.cg-contact-action.following { background:var(--cg-grad-soft); }
.cg-contact-action:hover { background:var(--cg-primary); color:#fff; }

/* ── Tab Llamadas ────────────────────────────────────────────── */
.cg-call-item { display:flex; align-items:center; gap:12px; padding:11px 16px; cursor:pointer; transition:background .12s; }
.cg-call-item:hover { background:rgba(255,255,255,.04); }
.cg-call-type { font-size:16px; flex-shrink:0; }
.cg-call-info { flex:1; min-width:0; }
.cg-call-name { font-size:14px; font-weight:600; }
.cg-call-detail { font-size:11px; color:var(--cg-muted); margin-top:1px; }
.cg-call-time { font-size:11px; color:var(--cg-muted2); }
.cg-call-missed .cg-call-name { color:#ff5555; }

/* ── Overlay de llamada ──────────────────────────────────────── */
/* ── Call Overlay premium ─────────────────────────────────── */
.cg-call-overlay {
  position:fixed; inset:0; z-index:500;
  background:radial-gradient(ellipse at 30% 20%,rgba(198,57,184,.25) 0%,transparent 60%),
             radial-gradient(ellipse at 70% 80%,rgba(30,142,233,.2) 0%,transparent 60%),
             #06060f;
  display:flex; flex-direction:column; align-items:center; justify-content:space-between;
  padding:40px 20px 36px; overflow:hidden;
}

/* Barra de estado conectado (top) */
.cg-call-bar {
  position:absolute; top:0; left:0; right:0; height:3px;
  background:linear-gradient(90deg,#00dcff,#c639b8,#00dcff);
  background-size:200%;
  animation:cgBarFlow 2s linear infinite;
  display:none;
}
.cg-call-bar.show { display:block; }
@keyframes cgBarFlow { 0%{background-position:0%} 100%{background-position:200%} }

/* Ondas de llamando */
.cg-call-rings {
  position:absolute; top:108px; left:50%; transform:translateX(-50%);
  width:110px; height:110px; pointer-events:none;
}
.cg-call-ring {
  position:absolute; inset:0; border-radius:50%;
  border:1.5px solid rgba(198,57,184,.35);
  animation:cgRingOut 2.2s ease-out infinite;
}
.cg-call-ring:nth-child(2) { animation-delay:.55s; }
.cg-call-ring:nth-child(3) { animation-delay:1.1s; }
@keyframes cgRingOut {
  0%{transform:scale(1);opacity:.7}
  100%{transform:scale(2.4);opacity:0}
}

/* Video remoto (fondo) */
.cg-call-remote-video {
  position:absolute; inset:0; z-index:0;
  background:#0a1520;
  display:none; align-items:center; justify-content:center;
}
.cg-call-remote-video.show { display:flex; }
.cg-call-remote-video video {
  width:100%; height:100%; object-fit:cover;
}
.cg-call-remote-placeholder {
  display:flex; flex-direction:column; align-items:center; gap:8px;
  opacity:.2; font-size:13px;
}

/* PiP — cámara local en videollamada */
.cg-call-pip {
  position:absolute; top:16px; right:16px; z-index:10;
  width:90px; height:130px; border-radius:14px; overflow:hidden;
  border:2px solid rgba(255,255,255,.2);
  background:#0d1a2a;
  display:none; align-items:center; justify-content:center;
  cursor:grab;
}
.cg-call-pip.show { display:flex; }
.cg-call-pip video { width:100%; height:100%; object-fit:cover; }
.cg-call-pip-label {
  position:absolute; bottom:6px; left:0; right:0;
  text-align:center; font-size:9px; color:rgba(255,255,255,.4); font-weight:600;
}

/* Avatar */
.cg-call-av {
  width:110px; height:110px; border-radius:50%; overflow:hidden;
  border:3px solid rgba(198,57,184,.45);
  animation:cgCallPulse 1.8s ease-in-out infinite;
  position:relative; z-index:2; flex-shrink:0;
}
.cg-call-av.connected {
  animation:cgCallPulseGreen 2.5s ease-in-out infinite;
  border-color:rgba(76,211,135,.5);
}
@keyframes cgCallPulse { 0%{box-shadow:0 0 0 0 rgba(198,57,184,.4)} 70%{box-shadow:0 0 0 28px rgba(198,57,184,0)} 100%{box-shadow:0 0 0 0 rgba(198,57,184,0)} }
@keyframes cgCallPulseGreen { 0%{box-shadow:0 0 0 0 rgba(76,211,135,.35)} 70%{box-shadow:0 0 0 22px rgba(76,211,135,0)} 100%{box-shadow:0 0 0 0 rgba(76,211,135,0)} }

/* Info */
.cg-call-info { text-align:center; z-index:2; }
.cg-call-name { font-size:24px; font-weight:800; margin-bottom:6px; }
.cg-call-status { font-size:13px; color:var(--cg-muted); display:flex; align-items:center; justify-content:center; gap:6px; }
.cg-call-status-dot { width:8px; height:8px; border-radius:50%; background:var(--cg-primary); animation:cgPulse .8s infinite alternate; }
.cg-call-status-dot.green { background:#4cd387; }
.cg-call-timer { font-size:15px; font-weight:700; color:rgba(255,255,255,.65); letter-spacing:1px; z-index:2; visibility:hidden; }
.cg-call-timer.show { visibility:visible; }

/* Controles */
.cg-call-controls { display:flex; gap:14px; margin-top:4px; align-items:flex-end; flex-wrap:wrap; justify-content:center; z-index:2; }
.cg-call-ctrl-wrap { display:flex; flex-direction:column; align-items:center; gap:5px; }
.cg-call-ctrl { width:62px; height:62px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:21px; transition:.15s; border:none; cursor:pointer; }
.cg-call-ctrl:active { transform:scale(.88); }
.cg-call-ctrl.end { background:#f44336; color:#fff; width:70px; height:70px; font-size:24px; }
.cg-call-ctrl.mute { background:rgba(255,255,255,.12); color:var(--cg-text); }
.cg-call-ctrl.mute.active { background:rgba(244,67,54,.22); color:#f87171; }
.cg-call-ctrl.speaker { background:rgba(255,255,255,.12); color:var(--cg-text); }
.cg-call-ctrl.speaker.active { background:rgba(0,220,255,.15); color:#00dcff; }
.cg-call-ctrl.video { background:rgba(255,255,255,.12); color:var(--cg-text); }
.cg-call-ctrl.video.off { background:rgba(244,67,54,.2); color:#f87171; }
.cg-call-ctrl.flip { background:rgba(255,255,255,.12); color:var(--cg-text); }
.cg-call-ctrl-label { font-size:10px; color:rgba(255,255,255,.4); font-weight:600; letter-spacing:.3px; }

/* ── CTG tab ─────────────────────────────────────────────────── */
.cg-ctg-banner {
  margin:16px; border-radius:18px; overflow:hidden;
  background:linear-gradient(135deg,#0f0c29,#302b63,#c639b8);
  padding:24px; display:flex; align-items:center; gap:16px; cursor:pointer;
  transition:transform .15s, box-shadow .15s;
}
.cg-ctg-banner:hover { transform:translateY(-2px); box-shadow:0 12px 40px rgba(198,57,184,.3); }
.cg-ctg-icon { font-size:40px; flex-shrink:0; }
.cg-ctg-info h3 { font-size:18px; font-weight:800; }
.cg-ctg-info p  { font-size:12px; opacity:.7; margin-top:4px; }

/* ── Incoming call toast ─────────────────────────────────────── */
.cg-incoming-call {
  position:fixed; top:calc(env(safe-area-inset-top) + 12px); left:12px; right:12px; z-index:600;
  background:rgba(13,13,26,.95); border:1px solid var(--cg-border);
  border-radius:18px; padding:14px 16px; display:flex; align-items:center; gap:12px;
  box-shadow:var(--cg-shadow); backdrop-filter:var(--cg-blur);
  animation:cgSlideDown .3s ease;
}
@keyframes cgSlideDown { from{transform:translateY(-20px);opacity:0} to{transform:translateY(0);opacity:1} }
.cg-incoming-info { flex:1; min-width:0; }
.cg-incoming-name { font-size:14px; font-weight:700; }
.cg-incoming-type { font-size:12px; color:var(--cg-muted); }
.cg-incoming-btns { display:flex; gap:8px; }
.cg-incoming-reject { width:44px; height:44px; border-radius:50%; background:#f44336; color:#fff; font-size:18px; display:flex; align-items:center; justify-content:center; }
.cg-incoming-accept { width:44px; height:44px; border-radius:50%; background:var(--cg-online); color:#fff; font-size:18px; display:flex; align-items:center; justify-content:center; }

/* ── Toast ───────────────────────────────────────────────────── */
.cg-toast-container { position:fixed; bottom:calc(var(--cg-nav-h) + 12px); left:50%; transform:translateX(-50%); z-index:9000; display:flex; flex-direction:column; align-items:center; gap:8px; width:max-content; max-width:90vw; }
.cg-toast { background:rgba(20,20,36,.95); border:1px solid var(--cg-border); border-radius:14px; padding:10px 18px; font-size:13px; font-weight:500; backdrop-filter:var(--cg-blur); box-shadow:var(--cg-shadow); animation:cgFadeInUp .25s ease; }
@keyframes cgFadeInUp { from{transform:translateY(8px);opacity:0} to{transform:translateY(0);opacity:1} }

/* ── Vacío/Loading ───────────────────────────────────────────── */
.cg-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:60px 20px; gap:12px; color:var(--cg-muted); text-align:center; }
.cg-empty-icon { font-size:48px; }
.cg-empty-title { font-size:16px; font-weight:700; color:var(--cg-text); }
.cg-empty-sub   { font-size:13px; }
.cg-spinner { width:32px; height:32px; border-radius:50%; border:3px solid rgba(198,57,184,.2); border-top-color:var(--cg-primary); animation:cgSpin .8s linear infinite; margin:40px auto; }
@keyframes cgSpin { to{transform:rotate(360deg)} }

/* ── Separadores de fecha ────────────────────────────────────── */
.cg-date-sep { text-align:center; font-size:11px; color:var(--cg-muted2); padding:8px 0; }

/* ── Menú contextual ─────────────────────────────────────────── */
.cg-ctx-overlay { position:fixed; inset:0; z-index:400; } /* mayor que nav(300) */
.cg-ctx-menu {
  position:fixed; z-index:301; min-width:180px;
  background:rgba(18,18,30,.98); border:1px solid var(--cg-border);
  border-radius:16px; padding:6px; backdrop-filter:var(--cg-blur);
  box-shadow:var(--cg-shadow); animation:cgFadeInUp .15s ease;
}
.cg-ctx-item { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; font-size:13px; cursor:pointer; transition:background .1s; }
.cg-ctx-item:hover { background:rgba(255,255,255,.07); }
.cg-ctx-item i   { width:16px; text-align:center; color:var(--cg-muted); font-size:14px; }
.cg-ctx-item.danger { color:#ff5555; }
.cg-ctx-item.danger i { color:#ff5555; }

/* ── Modal ───────────────────────────────────────────────────── */
.cg-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.7); z-index:400; display:flex; align-items:flex-end; justify-content:center; backdrop-filter:blur(4px); }
.cg-modal { background:var(--cg-bg2); border-radius:22px 22px 0 0; width:100%; max-width:500px; max-height:90vh; overflow-y:auto; padding:20px; }
.cg-modal-handle { width:36px; height:4px; border-radius:2px; background:rgba(255,255,255,.15); margin:0 auto 16px; }
.cg-modal h3 { font-size:16px; font-weight:700; margin-bottom:16px; }

/* ── Picker de emojis ────────────────────────────────────────── */
.cg-picker { position:absolute; bottom:calc(100% + 8px); left:0; width:280px; z-index:200; background:var(--cg-bg2); border:1px solid var(--cg-border); border-radius:16px; padding:8px; box-shadow:var(--cg-shadow); animation:cgFadeInUp .15s ease; }
.cg-picker-grid { display:grid; grid-template-columns:repeat(8,1fr); gap:2px; max-height:200px; overflow-y:auto; }
.cg-picker-emoji { font-size:22px; text-align:center; padding:4px; border-radius:8px; cursor:pointer; }
.cg-picker-emoji:hover { background:rgba(255,255,255,.08); }

/* ── Avatar genérico ─────────────────────────────────────────── */
.cg-av { width:48px; height:48px; border-radius:50%; background:var(--cg-bg3); display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:700; overflow:hidden; flex-shrink:0; }
.cg-av img { width:100%; height:100%; object-fit:cover; }

/* ── Desktop: dos columnas (≥ 768px) ────────────────────────── */
@media (min-width:768px) {
  #cgApp { flex-direction:row; }
  .cg-header { display:none; }
  .cg-main { border-right:1px solid var(--cg-border); min-width:300px; max-width:380px; padding-bottom:var(--cg-nav-h); }
  /* .cg-nav desktop ya está en el bloque premium del nav */
  .cg-conv-panel { left:380px; right:0; width:auto; bottom:0; transform:none !important; transition:none; display:flex !important; }
  .cg-conv-panel:not(.open) .cg-messages { display:flex; align-items:center; justify-content:center; }
  #cgApp { overflow:hidden; }
}

@media (min-width:1024px) {
  .cg-main { max-width:420px; }
  /* .cg-nav 420px ya en el bloque premium */
  .cg-conv-panel { left:420px; }
}

/* ── Indicador grabando ──────────────────────────────────── */
.cg-recording-indicator { display:flex; align-items:center; gap:4px; animation:cgPulse 1s ease-in-out infinite; }

/* ── Estilos paso wizard email/teléfono ──────────────────── */
.cg-otp-resend { color:var(--cg-primary); background:none; border:none; font-size:12px; cursor:pointer; margin-top:6px; font-family:var(--cg-font); text-decoration:underline; }
/* ════════════════════════════════════════════════════════
   NUEVOS ESTILOS — Actualización masiva ChatG
════════════════════════════════════════════════════════ */

/* ── Buscador inline en lista de chats ───────────────── */
.cg-chat-search-wrap {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 14px 4px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 20px; padding: 8px 14px;
  transition: border-color .15s;
}
.cg-chat-search-wrap:focus-within { border-color: rgba(198,57,184,.4); }
.cg-chat-search-icon { color: var(--cg-muted); font-size: 13px; flex-shrink: 0; }
.cg-chat-search-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--cg-text); font-size: 14px; font-family: var(--cg-font);
}
.cg-chat-search-input::placeholder { color: var(--cg-muted2); }

/* ── Filtros chips ───────────────────────────────────── */
.cg-filter-chips {
  display: flex; gap: 6px; padding: 6px 14px 8px;
  overflow-x: auto; scrollbar-width: none;
}
.cg-filter-chips::-webkit-scrollbar { display: none; }
.cg-chip {
  flex-shrink: 0; padding: 5px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600; font-family: var(--cg-font);
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: var(--cg-muted); cursor: pointer;
  transition: all .15s;
}
.cg-chip:hover { border-color: rgba(198,57,184,.4); color: var(--cg-primary); }
.cg-chip.active {
  background: linear-gradient(135deg,rgba(198,57,184,.2),rgba(30,142,233,.15));
  border-color: rgba(198,57,184,.5); color: var(--cg-primary); font-weight: 700;
}

/* ── Barra de reacciones inline (long-press) ─────────── */
.cg-reaction-bar {
  animation: cgFadeInUp .18s ease;
}
@keyframes cgFadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cgSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cgSlideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Barra de acciones inferior (long-press) ─────────── */
.cg-action-bar-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--cg-text); font-family: var(--cg-font);
  padding: 6px 10px; border-radius: 10px;
  transition: background .12s;
  min-width: 52px;
}
.cg-action-bar-btn:hover { background: rgba(255,255,255,.08); }
.cg-action-bar-btn i { font-size: 18px; }
.cg-action-bar-btn span { font-size: 10px; color: var(--cg-muted); }
.cg-action-bar-btn.cg-action-danger { color: #ef4444; }
.cg-action-bar-btn.cg-action-danger span { color: #ef4444; }

/* ── Menú banner superior (long-press thread) ────────── */
.cg-thread-menu-item:hover { background: rgba(255,255,255,.06); }
.cg-thread-menu-item.cg-action-danger { color: #ef4444; }

/* ── Ajustes hover en sección menú ──────────────────── */
[data-menu-fn]:hover { background: rgba(255,255,255,.04); }
/* ════════════════════════════════════════════════════════
   NUEVOS ESTILOS — Fase 2 ChatG
════════════════════════════════════════════════════════ */

/* ── Botón + superpuesto en historia propia ──────────── */
.cg-story-add-btn {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--cg-grad);
  color: #fff;
  border: 2px solid var(--cg-bg);
  font-size: 14px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 5;
  transition: transform .15s;
  padding: 0;
}
.cg-story-add-btn:hover { transform: scale(1.15); }

/* ── PIN Gate dots ───────────────────────────────────── */
.cg-pin-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.3);
  transition: background .15s, transform .12s;
}
.cg-pin-key:hover { background: rgba(255,255,255,.12) !important; }
.cg-pin-key:active { transform: scale(.93); }

/* ── Sección archivados al final ─────────────────────── */
.cg-archived-toggle:hover { background: rgba(255,255,255,.04); }

/* ── Reply banner encima del input ──────────────────── */
.cg-reply-banner {
  border-top: 1px solid rgba(255,255,255,.07);
  animation: cgSlideUp .18s ease;
}

/* ── Contact card en burbuja ─────────────────────────── */
.cg-contact-card { transition: opacity .15s; }
.cg-contact-card:hover { opacity: .88; }

/* ── Emoji picker — no se cierra al seleccionar ─────── */
#cgEmojiPicker { transition: opacity .15s; }
.cg-emoji-pulse { animation: emojiPulse .15s ease; }
@keyframes emojiPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ── Mic button — visual al grabar ──────────────────── */
.cg-btn-mic.recording {
  color: #ef4444 !important;
  background: rgba(239,68,68,.1) !important;
  animation: micPulse 1s ease-in-out infinite;
}
@keyframes micPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.3); }
  50%      { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

/* ── Chips de filtro: hover mejorado ─────────────────── */
.cg-chip { transition: all .15s; }

/* ── Visor historias — previene selección de texto ──── */
#cgStoryViewer { user-select: none; -webkit-user-select: none; }


/* ════════════════════════════════════════════════════════════
   CTG — Competencia de Talento Global — Estilos Premium
   Prefijo ctg- para evitar colisiones con el resto de ChatG
════════════════════════════════════════════════════════════ */

/* ── Variables CTG ───────────────────────────────────────── */
:root, :host {
  --ctg-gold:    #ffd700;
  --ctg-silver:  #c0c0c0;
  --ctg-bronze:  #cd7f32;
  --ctg-grad:    linear-gradient(135deg,#c639b8 0%,#7c3aed 50%,#1e8ee9 100%);
  --ctg-grad-rev:linear-gradient(135deg,#1e8ee9 0%,#7c3aed 50%,#c639b8 100%);
  --ctg-glass:   rgba(255,255,255,.04);
  --ctg-border:  rgba(255,255,255,.08);
  --ctg-radius:  18px;
  --ctg-shadow:  0 8px 32px rgba(0,0,0,.4);
}

/* ── Layout principal ───────────────────────────────────── */
.ctg-main {
  background: transparent;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.ctg-wrap {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .35s ease, transform .35s ease;
  padding-bottom: calc(var(--cg-nav-h) + 24px);
}
.ctg-wrap--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Section title ──────────────────────────────────────── */
.ctg-section-title {
  font-size: 16px; font-weight: 800;
  color: var(--cg-text);
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 16px;
}
.ctg-section-title i { color: var(--cg-primary); font-size: 14px; }

.ctg-btn-text {
  background: none; border: none; cursor: pointer;
  color: var(--cg-primary); font-size: 12px; font-weight: 600;
  font-family: var(--cg-font);
  display: flex; align-items: center; gap: 4px;
  padding: 4px 0; transition: opacity .15s;
}
.ctg-btn-text:hover { opacity: .75; }

/* ════ BANNER ════════════════════════════════════════════ */
.ctg-banner {
  position: relative; overflow: hidden;
  margin: 0 0 20px;
  min-height: 280px;
  display: flex; align-items: center;
  background: linear-gradient(145deg,#0c0a1e 0%,#1a0a3e 50%,#0a1a3e 100%);
}

.ctg-banner__bg {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
}
.ctg-banner__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(198,57,184,.06) 1px,transparent 1px),
    linear-gradient(90deg,rgba(198,57,184,.06) 1px,transparent 1px);
  background-size: 32px 32px;
  animation: ctgGridPulse 6s ease-in-out infinite;
}
@keyframes ctgGridPulse { 0%,100%{opacity:.4} 50%{opacity:1} }

.ctg-banner__orb {
  position: absolute; border-radius: 50%;
  animation: ctgOrbFloat ease-in-out infinite;
}
.ctg-banner__orb--1 {
  width: 300px; height: 300px; top: -80px; left: -60px;
  background: radial-gradient(circle,rgba(198,57,184,.25) 0%,transparent 70%);
  animation-duration: 8s;
}
.ctg-banner__orb--2 {
  width: 250px; height: 250px; bottom: -60px; right: -40px;
  background: radial-gradient(circle,rgba(30,142,233,.2) 0%,transparent 70%);
  animation-duration: 10s; animation-delay: 2s;
}
.ctg-banner__orb--3 {
  width: 180px; height: 180px; top: 40%; right: 30%;
  background: radial-gradient(circle,rgba(124,58,237,.18) 0%,transparent 70%);
  animation-duration: 12s; animation-delay: 4s;
}
@keyframes ctgOrbFloat {
  0%,100% { transform: translate(0,0); }
  50%     { transform: translate(20px,-20px); }
}

.ctg-banner__content {
  position: relative; z-index: 1;
  padding: 28px 20px 24px;
  width: 100%;
}

.ctg-banner__badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(198,57,184,.15);
  border: 1px solid rgba(198,57,184,.3);
  border-radius: 20px; padding: 5px 14px;
  font-size: 11px; font-weight: 700;
  color: rgba(198,57,184,.9);
  letter-spacing: .5px; text-transform: uppercase;
  margin-bottom: 14px;
}

.ctg-banner__title {
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 900; line-height: 1.1;
  color: #fff; margin-bottom: 12px;
}
.ctg-banner__title--accent {
  background: var(--ctg-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ctg-banner__desc {
  font-size: 13px; color: rgba(255,255,255,.6);
  line-height: 1.6; max-width: 420px; margin-bottom: 20px;
}

.ctg-banner__cta-row {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px;
}

/* Botón CTA primario */
.ctg-cta-btn {
  position: relative; overflow: hidden;
  padding: 12px 22px; border-radius: 14px;
  font-size: 14px; font-weight: 700; font-family: var(--cg-font);
  cursor: pointer; transition: transform .15s, box-shadow .15s;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.ctg-cta-btn:hover { transform: translateY(-2px); }
.ctg-cta-btn:active { transform: translateY(0) scale(.97); }

.ctg-cta-btn--primary {
  background: var(--ctg-grad); color: #fff; border: none;
  box-shadow: 0 4px 20px rgba(198,57,184,.4);
}
.ctg-cta-btn--primary:hover {
  box-shadow: 0 8px 32px rgba(198,57,184,.55);
}
.ctg-cta-btn__glow {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  transform: translateX(-100%);
  animation: ctgGlowSweep 3s ease-in-out infinite;
}
@keyframes ctgGlowSweep {
  0%  { transform: translateX(-100%); }
  60%,100% { transform: translateX(100%); }
}

.ctg-cta-btn--outline {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.85);
}
.ctg-cta-btn--outline:hover {
  border-color: rgba(198,57,184,.5);
  background: rgba(198,57,184,.08);
  color: #fff;
}

/* Métricas del banner */
.ctg-banner__metrics {
  display: flex; gap: 20px; flex-wrap: wrap;
}
.ctg-banner__metric {
  display: flex; flex-direction: column; gap: 2px;
}
.ctg-banner__metric-num {
  font-size: 20px; font-weight: 800; color: #fff;
}
.ctg-banner__metric-lbl {
  font-size: 11px; color: rgba(255,255,255,.5);
}

/* ════ STATS ═════════════════════════════════════════════ */
.ctg-stats {
  padding: 0 16px 20px;
}
.ctg-stats__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.ctg-stat-card {
  position: relative; overflow: hidden;
  background: var(--ctg-glass);
  border: 1px solid var(--ctg-border);
  border-radius: var(--ctg-radius);
  padding: 16px; text-align: center;
  transition: transform .15s, box-shadow .15s;
  cursor: default;
}
.ctg-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3), 0 0 0 1px var(--ctg-accent, var(--cg-primary));
}
.ctg-stat-card__icon { font-size: 24px; margin-bottom: 6px; }
.ctg-stat-card__val  { font-size: 22px; font-weight: 800; color: var(--ctg-accent,var(--cg-primary)); }
.ctg-stat-card__lbl  { font-size: 11px; color: var(--cg-muted); margin-top: 3px; }
.ctg-stat-card__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.06) 0%, transparent 70%);
}

/* ════ LEADERBOARD ═══════════════════════════════════════ */
.ctg-leaderboard {
  padding: 0 16px 24px;
}
.ctg-leaderboard__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}

/* ── Avatar ── */
.ctg-avatar {
  position: relative; flex-shrink: 0;
  width: 52px; height: 52px;
}
.ctg-avatar--sm  { width: 40px; height: 40px; }
.ctg-avatar--xl  { width: 80px; height: 80px; }

.ctg-avatar__inner {
  width: 100%; height: 100%; border-radius: 50%;
  background: linear-gradient(135deg,var(--rank-color,#c639b8),rgba(0,0,0,.4));
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--avatar-fs, 1) * 18px);
  font-weight: 800; color: #fff;
  position: relative; z-index: 1;
}
.ctg-avatar--sm  .ctg-avatar__inner { font-size: 14px; }
.ctg-avatar--xl  .ctg-avatar__inner { font-size: 26px; }

.ctg-avatar__ring {
  position: absolute; inset: -2px; border-radius: 50%;
  background: conic-gradient(var(--rank-color,#c639b8), #1e8ee9, var(--rank-color,#c639b8));
  z-index: 0;
  animation: ctgRingRotate 4s linear infinite;
}
.ctg-avatar__ring::before {
  content: '';
  position: absolute; inset: 2px; border-radius: 50%;
  background: var(--cg-bg);
}
@keyframes ctgRingRotate { to { transform: rotate(360deg); } }

.ctg-avatar__sparkle {
  position: absolute; inset: -6px; border-radius: 50%;
  background: radial-gradient(circle,var(--rank-color,#c639b8) 0%,transparent 60%);
  opacity: .3; z-index: -1;
  animation: ctgSparkle 2s ease-in-out infinite;
}
@keyframes ctgSparkle { 0%,100%{opacity:.2;transform:scale(1)} 50%{opacity:.5;transform:scale(1.15)} }

/* ── Podio ── */
.ctg-podium {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 8px; padding: 20px 8px 16px;
  background: var(--ctg-glass);
  border: 1px solid var(--ctg-border);
  border-radius: var(--ctg-radius);
  margin-bottom: 12px;
  position: relative; overflow: hidden;
}
.ctg-podium::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(198,57,184,.08) 0%, transparent 60%);
  pointer-events: none;
}

.ctg-podium__col {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex: 1; cursor: pointer; padding: 8px 4px;
  border-radius: 12px; transition: background .15s;
  position: relative;
}
.ctg-podium__col:hover { background: rgba(255,255,255,.05); }

.ctg-podium__col--1st { order: 2; padding-bottom: 0; }
.ctg-podium__col--2nd { order: 1; }
.ctg-podium__col--3rd { order: 3; }

.ctg-podium__crown {
  font-size: 20px;
  animation: ctgCrownBounce 2s ease-in-out infinite;
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
}
@keyframes ctgCrownBounce { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(-4px)} }

.ctg-podium__rank  { font-size: 20px; }
.ctg-podium__name  { font-size: 11px; font-weight: 700; color: var(--cg-text); text-align: center; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctg-podium__prof  { font-size: 9px; color: var(--cg-muted); text-align: center; }
.ctg-podium__score { font-size: 11px; font-weight: 700; color: var(--cg-primary); }

/* ── Filas de ranking ── */
.ctg-lb-list { display: flex; flex-direction: column; gap: 6px; }

.ctg-lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--ctg-glass);
  border: 1px solid var(--ctg-border);
  border-radius: 14px; cursor: pointer;
  transition: background .12s, transform .12s, border-color .12s;
}
.ctg-lb-row:hover {
  background: rgba(255,255,255,.07);
  transform: translateX(3px);
  border-color: rgba(198,57,184,.25);
}

.ctg-lb-row__rank {
  width: 24px; text-align: center;
  font-size: 13px; font-weight: 700; color: var(--cg-muted);
  flex-shrink: 0;
}
.ctg-lb-row__info  { flex: 1; min-width: 0; }
.ctg-lb-row__name  { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.ctg-lb-row__prof  { font-size: 11px; color: var(--cg-muted); margin-top: 1px; }
.ctg-lb-row__score { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.ctg-lb-row__pts   { font-size: 14px; font-weight: 800; color: var(--cg-primary); }
.ctg-lb-row__lbl   { font-size: 9px; color: var(--cg-muted); }

.ctg-lb-badge { font-size: 14px; }

/* ════ ACHIEVEMENTS ══════════════════════════════════════ */
.ctg-achievements { padding: 0 16px 24px; }
.ctg-achievements__sub {
  font-size: 12px; color: var(--cg-muted);
  margin-bottom: 14px; margin-top: -10px;
}
.ctg-achievements__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.ctg-achievement-card {
  position: relative; overflow: hidden;
  background: var(--ctg-glass);
  border: 1px solid var(--ctg-border);
  border-radius: 14px; padding: 14px 8px;
  text-align: center; cursor: default;
  transition: transform .15s, box-shadow .15s;
}
.ctg-achievement-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  border-color: var(--ach-color, var(--cg-primary));
}
.ctg-achievement-card__icon  { font-size: 24px; margin-bottom: 6px; }
.ctg-achievement-card__title { font-size: 10px; font-weight: 700; color: var(--cg-text); }
.ctg-achievement-card__desc  { font-size: 9px; color: var(--cg-muted); margin-top: 2px; display: none; }
.ctg-achievement-card__rarity{
  font-size: 8px; font-weight: 700; letter-spacing: .5px;
  color: var(--ach-color, var(--cg-primary));
  text-transform: uppercase; margin-top: 4px;
}
.ctg-achievement-card__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.06) 0%, transparent 60%);
}
.ctg-achievement-card--legendary {
  background: linear-gradient(145deg,rgba(255,215,0,.08),rgba(255,140,0,.05));
  border-color: rgba(255,215,0,.2);
}
.ctg-achievement-card--epic {
  background: linear-gradient(145deg,rgba(239,68,68,.08),rgba(124,58,237,.05));
  border-color: rgba(239,68,68,.2);
}

/* ════ PERFIL MODAL ══════════════════════════════════════ */
.ctg-modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.75);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .28s ease;
}
.ctg-modal-overlay--visible { opacity: 1; }
.ctg-modal-overlay--visible .ctg-profile-modal {
  transform: translateY(0);
}

.ctg-profile-modal {
  width: 100%; max-width: 500px;
  max-height: 90vh; overflow-y: auto;
  background: var(--cg-bg2);
  border-radius: 24px 24px 0 0;
  transform: translateY(40px);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}

.ctg-profile-modal__hero {
  position: relative; min-height: 140px;
  background: linear-gradient(135deg,var(--hero-color,#c639b8) 0%,rgba(0,0,0,.8) 100%);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 20px;
  border-radius: 24px 24px 0 0; overflow: hidden;
}
.ctg-profile-modal__hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.1) 0%, transparent 60%);
}

.ctg-profile-modal__close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%; width: 32px; height: 32px;
  color: #fff; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; z-index: 5;
}
.ctg-profile-modal__close:hover { background: rgba(0,0,0,.6); }

.ctg-profile-modal__rank-badge {
  position: absolute; bottom: 14px; right: 20px;
  font-size: 28px;
}

.ctg-profile-modal__body {
  padding: 20px 20px 24px; text-align: center;
}
.ctg-profile-modal__name {
  font-size: 20px; font-weight: 800; color: var(--cg-text); margin-bottom: 4px;
}
.ctg-profile-modal__prof {
  font-size: 13px; color: var(--cg-muted); margin-bottom: 18px;
}

.ctg-profile-modal__stats {
  display: flex; justify-content: center; gap: 28px; margin-bottom: 18px;
}
.ctg-profile-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ctg-profile-stat__val { font-size: 20px; font-weight: 800; color: var(--cg-primary); }
.ctg-profile-stat__lbl { font-size: 11px; color: var(--cg-muted); }

.ctg-profile-modal__badges {
  display: flex; justify-content: center; gap: 8px; margin-bottom: 18px;
  flex-wrap: wrap;
}
.ctg-badge-chip {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--chip-color, rgba(255,255,255,.1));
  border-radius: 20px; padding: 4px 10px; font-size: 16px;
  cursor: default; transition: transform .12s;
}
.ctg-badge-chip:hover { transform: scale(1.1); }

/* Barra de nivel */
.ctg-profile-modal__level-bar { margin-bottom: 20px; }
.ctg-level-bar__label {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--cg-muted); margin-bottom: 6px;
}
.ctg-level-bar__track {
  height: 6px; background: rgba(255,255,255,.1);
  border-radius: 3px; overflow: hidden;
}
.ctg-level-bar__fill {
  height: 100%; background: var(--ctg-grad);
  border-radius: 3px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

.ctg-profile-modal__actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* ── Botones de acción en modal ── */
.ctg-action-btn {
  flex: 1; min-width: 90px;
  padding: 11px 14px; border-radius: 14px;
  font-size: 13px; font-weight: 700; font-family: var(--cg-font);
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: transform .12s, opacity .12s;
}
.ctg-action-btn:hover { transform: translateY(-1px); }
.ctg-action-btn:active { transform: translateY(0) scale(.97); }

.ctg-action-btn--primary {
  background: var(--ctg-grad); color: #fff; border: none;
  box-shadow: 0 4px 16px rgba(198,57,184,.35);
}
.ctg-action-btn--outline {
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.15);
  color: var(--cg-text);
}
.ctg-action-btn--outline:hover { border-color: var(--cg-primary); color: var(--cg-primary); }
.ctg-action-btn--ghost {
  background: none; border: none;
  color: var(--cg-muted); font-size: 12px;
}
.ctg-action-btn--ghost:hover { color: var(--cg-primary); }

/* ════ RESPONSIVE ════════════════════════════════════════ */

/* Tablet (768px+) */
@media (min-width: 768px) {
  .ctg-stats__grid        { grid-template-columns: repeat(4, 1fr); }
  .ctg-achievements__grid { grid-template-columns: repeat(6, 1fr); }
  .ctg-banner__content    { padding: 40px 32px 32px; }
  .ctg-banner__title      { font-size: 34px; }
  .ctg-achievement-card__desc { display: block; }
  .ctg-podium__name  { font-size: 12px; max-width: 100px; }
  .ctg-lb-row { padding: 14px 18px; }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .ctg-banner { min-height: 320px; }
  .ctg-banner__title { font-size: 40px; }
  .ctg-achievements__grid { grid-template-columns: repeat(8, 1fr); }
  .ctg-leaderboard { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .ctg-leaderboard__header { grid-column: 1/-1; }
  .ctg-profile-modal { border-radius: 24px; margin: auto; max-height: 80vh; }
  .ctg-modal-overlay { align-items: center; }
}

@media (min-width: 1280px) {
  .ctg-stats__grid { gap: 16px; }
  .ctg-stat-card { padding: 20px; }
  .ctg-stat-card__val { font-size: 26px; }
  .ctg-banner__content { padding: 52px 40px; max-width: 600px; }
}

/* ══════════════════════════════════════════════════════
   FAB — Botón flotante Nuevo Chat
   Posicionado sobre el tab CTG (último de la nav)
══════════════════════════════════════════════════════ */
.cg-fab {
  position: fixed;
  /* Alineado sobre el botón CTG: nav tiene 4 items → CTG ocupa el último cuarto
     right: nav-item-width/2 desde el borde = ~calc(25%/2) del ancho del nav
     En móvil ≈ 25vw de ancho por item → centro del último item ≈ right: 12.5vw - 26px */
  right: calc(12.5vw - 26px);
  bottom: calc(var(--cg-nav-h, 64px) + env(safe-area-inset-bottom) + 12px);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--cg-grad, linear-gradient(135deg,#c639b8,#1e8ee9));
  color: #fff;
  font-size: 20px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(198,57,184,.45), 0 2px 8px rgba(0,0,0,.3);
  z-index: 200;
  /* Estado inicial: invisible, listo para animar */
  opacity: 0;
  transform: scale(0.7) translateY(8px);
  transition: opacity .2s ease, transform .2s ease, box-shadow .15s ease;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}

/* Estado visible — añadido por JS con requestAnimationFrame */
.cg-fab--visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.cg-fab:hover,
.cg-fab:focus-visible {
  box-shadow: 0 6px 28px rgba(198,57,184,.6), 0 3px 12px rgba(0,0,0,.3);
  transform: scale(1.08) translateY(0);
  outline: none;
}

.cg-fab:active {
  transform: scale(0.95) translateY(0);
}

/* En desktop (panel dividido) el FAB va a la derecha del panel izquierdo */
@media (min-width: 768px) {
  .cg-fab {
    right: auto;
    left: calc(380px - 70px); /* panel izquierdo 380px → FAB dentro de él */
    bottom: calc(var(--cg-nav-h, 64px) + 16px);
  }
}

@media (min-width: 1024px) {
  .cg-fab {
    left: calc(420px - 70px);
  }
}

/* ══════════════════════════════════════════════════════
   WALLPAPER / Fondo de chat personalizado
══════════════════════════════════════════════════════ */
.cg-messages--bg {
  background-attachment: local;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* ══════════════════════════════════════════════════════
   PILLS — Filtros de contactos (Seguidores/Seguidos)
══════════════════════════════════════════════════════ */
.cg-tab-pills {
  display: flex;
  gap: 8px;
  padding: 8px 16px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cg-tab-pills::-webkit-scrollbar { display: none; }

.cg-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--cg-border, rgba(255,255,255,.1));
  background: transparent;
  color: var(--cg-muted, #888);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}

.cg-pill--active,
.cg-pill:hover {
  background: var(--cg-grad-soft, rgba(198,57,184,.12));
  color: var(--cg-primary, #c639b8);
  border-color: var(--cg-primary, #c639b8);
}

/* ══════════════════════════════════════════════════════
   WALLPAPER — fix zoom excesivo
══════════════════════════════════════════════════════ */
.cg-messages[style*="background-image"] {
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: local !important;
}










.cg-messages--themed {
  background-color: var(--cg-bg-color, transparent);
  background-image: var(--cg-bg-layer, none);
  background-size: var(--cg-bg-size, cover);
  background-repeat: var(--cg-bg-repeat, no-repeat);
  background-position: center center;
  /* FIX (zoom excesivo + "se mueve al hacer scroll"): "local" calcula el
     tamaño/posición del fondo contra TODO el área scrolleable (el historial
     completo de mensajes), no solo lo visible — por eso se veía con zoom
     desproporcionado y se desplazaba al subir a ver mensajes viejos.
     "scroll" lo fija contra el propio cuadro visible del chat, quieto. */
  background-attachment: scroll;
}

/* ══════════════════════════════════════════════════════════════
   CS/S — Comunidad Seguidores / Seguidos
══════════════════════════════════════════════════════════════ */

/* Nav ya maneja 5 items con position:absolute — no necesita grid */

.css-main {
  padding: 0 0 calc(var(--cg-nav-h, 64px) + env(safe-area-inset-bottom) + 16px);
  background: transparent;
  min-height: 0;
}

/* ── Nota conceptual ──────────────────────────────────────── */
.css-intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  margin: 12px 12px 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(198,57,184,.08), rgba(30,142,233,.06));
  border: 1px solid rgba(198,57,184,.18);
}
.css-intro__row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.css-intro__icon {
  font-size: 17px; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--cg-grad, linear-gradient(135deg,#c639b8,#1e8ee9));
}
.css-intro strong {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--cg-text, #fff);
  background: var(--cg-grad, linear-gradient(135deg,#c639b8,#1e8ee9));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.css-intro span {
  font-size: 12.5px; color: var(--cg-muted, #888); line-height: 1.5;
  text-align: justify;
}

/* ── Grid de 2 columnas ───────────────────────────────────── */
.css-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
}

/* ── Tarjeta glassmorphism ────────────────────────────────── */
.css-card {
  border-radius: 18px;
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  transition: box-shadow .2s;
}
.css-card--followers { border-color: rgba(198,57,184,.22); box-shadow: 0 0 18px rgba(198,57,184,.08); }
.css-card--following { border-color: rgba(30,142,233,.22); box-shadow: 0 0 18px rgba(30,142,233,.08); }
.css-card--followers:hover { box-shadow: 0 0 28px rgba(198,57,184,.18); }
.css-card--following:hover { box-shadow: 0 0 28px rgba(30,142,233,.18); }

.css-card__header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.css-card__icon { font-size: 15px; }
.css-card__title { font-size: 12px; font-weight: 700; color: var(--cg-text,#fff); flex: 1; }
.css-card__count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  color: var(--cg-muted,#888);
}

.css-card--followers .css-card__title { color: #c639b8; }
.css-card--following .css-card__title { color: #1e8ee9; }

.css-card__list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.css-card__list::-webkit-scrollbar { display: none; }
.css-card__loading { display: flex; align-items: center; justify-content: center; padding: 40px 0; }

/* ── Tarjeta de usuario ───────────────────────────────────── */
.css-user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .12s;
  position: relative;
}
.css-user-card:last-child { border-bottom: none; }
.css-user-card:hover { background: rgba(255,255,255,.03); }

.css-user-card__av { flex-shrink: 0; }
.css-user-card__info { flex: 1; min-width: 0; }
.css-user-card__name {
  font-size: 12px;
  font-weight: 700;
  color: var(--cg-text,#fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.css-user-card__user { font-size: 10px; color: var(--cg-muted,#888); margin-bottom: 5px; }

/* Contadores CTG */
.css-user-card__ctg { display: flex; gap: 5px; flex-wrap: wrap; }
.css-ctg-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 10px;
  border: none;
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform .12s, opacity .12s;
}
.css-ctg-btn:hover { transform: scale(1.06); }
.css-ctg-btn:active { transform: scale(0.96); }
.css-ctg-btn--trophy {
  background: rgba(255,215,0,.1);
  color: #ffd700;
  border: 1px solid rgba(255,215,0,.2);
}
.css-ctg-btn--gem {
  background: rgba(30,142,233,.1);
  color: #1e8ee9;
  border: 1px solid rgba(30,142,233,.2);
}

/* Botón mensaje */
.css-msg-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cg-grad, linear-gradient(135deg,#c639b8,#1e8ee9));
  color: #fff;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 10px rgba(198,57,184,.3);
}
.css-msg-btn:hover { transform: scale(1.12); box-shadow: 0 4px 16px rgba(198,57,184,.45); }
.css-msg-btn:active { transform: scale(0.94); }

/* ── Empty state ──────────────────────────────────────────── */
.css-empty {
  padding: 28px 12px;
  text-align: center;
  font-size: 11px;
  color: var(--cg-muted, #888);
  line-height: 1.5;
}

/* ── Modal overlay (Trofeos / Gemas) ─────────────────────── */
.css-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: cgFadeIn .18s ease;
}
.css-modal {
  background: var(--cg-bg2, #0d0d1a);
  border-radius: 22px 22px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(255,255,255,.1);
  animation: cgSlideUp .22s ease;
}
.css-modal__handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,.15);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}
.css-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--cg-text,#fff);
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.css-modal__close {
  background: none; border: none;
  color: var(--cg-muted,#888);
  font-size: 22px; cursor: pointer;
  padding: 0 4px; line-height: 1;
}
.css-modal__body { flex: 1; overflow-y: auto; padding: 14px 20px 24px; }

/* ── Trofeos ──────────────────────────────────────────────── */
.css-trophy-group { margin-bottom: 16px; }
.css-trophy-group__cat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--cg-muted,#888);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.css-trophy-badge {
  background: rgba(255,215,0,.15);
  color: #ffd700;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
}
.css-trophy-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
}
.css-trophy-item:last-child { margin-bottom: 0; }
.css-trophy-item__icon { font-size: 20px; flex-shrink: 0; }
.css-trophy-item__grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
}
.css-trophy-col { text-align: center; min-width: 0; }
.css-trophy-col:first-child { text-align: left; }
.css-trophy-col:last-child { text-align: right; }
.css-trophy-col__label {
  font-size: 9px; font-weight: 700; color: var(--cg-muted,#888);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px;
}
.css-trophy-col__val {
  font-size: 12px; font-weight: 600; color: var(--cg-text,#fff);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.css-trophy-col:last-child .css-trophy-col__val { color: #1e8ee9; font-weight: 700; }

/* ── Temporadas / Gemas ───────────────────────────────────── */
.css-season-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.css-season-row:last-child { border-bottom: none; }
.css-season-row__num {
  font-size: 13px;
  font-weight: 700;
  color: var(--cg-text,#fff);
}
.css-season-row__stats { display: flex; gap: 12px; }
.css-season-gem { font-size: 12px; color: #1e8ee9; font-weight: 600; }
.css-season-vid { font-size: 12px; color: var(--cg-muted,#888); }

/* ── Desktop: grid de 2 cols con más espacio ──────────────── */
@media (min-width: 480px) {
  .css-grid { padding: 16px; gap: 14px; }
  .css-card { min-height: 380px; }
  .css-user-card { padding: 11px 14px; }
  .css-user-card__name { font-size: 13px; }
}

@media (min-width: 768px) {
  .css-grid { grid-template-columns: 1fr 1fr; max-width: 700px; margin: 0 auto; }
}


/* ══════════════════════════════════════════════════════════════
   FAB — Estado estricto actualizado
   Solo display:flex cuando .cg-fab--visible Y tab=chats
══════════════════════════════════════════════════════════════ */
.cg-fab {
  display: none !important; /* oculto por defecto SIEMPRE */
  position: fixed;
  right: calc(12.5vw - 26px);
  bottom: calc(var(--cg-nav-h, 64px) + env(safe-area-inset-bottom) + 12px);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--cg-grad, linear-gradient(135deg,#c639b8,#1e8ee9));
  color: #fff;
  font-size: 20px;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(198,57,184,.45), 0 2px 8px rgba(0,0,0,.3);
  z-index: 200;
  opacity: 0;
  transform: scale(0.7) translateY(8px);
  transition: opacity .2s ease, transform .2s ease, box-shadow .15s ease;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}
/* Solo se muestra cuando JS añade la clase --visible */
.cg-fab--visible {
  display: flex !important;
  opacity: 1 !important;
  transform: scale(1) translateY(0) !important;
  pointer-events: auto !important;
}
.cg-fab:hover { box-shadow: 0 6px 28px rgba(198,57,184,.6); transform: scale(1.08); }
.cg-fab:active { transform: scale(0.95); }

@media (min-width: 768px) {
  .cg-fab { right: auto; left: calc(380px - 70px); }
}

/* ══════════════════════════════════════════════════════════════
   CS/S — Header mejorado con nota conceptual
══════════════════════════════════════════════════════════════ */
.css-header {
  padding: 4px 0 0;
  flex-shrink: 0; /* no comprimir el header en el flex column */
}
.css-header__top {
  padding: 12px 12px 0;
}

/* ══════════════════════════════════════════════════════════════
   Emoji Picker — empuje del DOM al abrirse
══════════════════════════════════════════════════════════════ */
.cg-messages {
  transition: padding-bottom .2s ease;
}

/* ══════════════════════════════════════════════════════════════
   Teclados virtuales — ELIMINADOS (display:none)
   El panel de temas tipográficos y el QWERTY se ocultan.
   El botón que los activaba queda sin efecto visual.
══════════════════════════════════════════════════════════════ */
#cgVirtualKeyboard,
#cgVirtualKeyboard.open,
#cgVK {
  display: none !important;
}

/* Lock screen PIN — se mantiene */
#cgRestrictedLock { animation: cgFadeIn .18s ease; }
#cgLockPad button[data-key]:active { transform: scale(0.92); background: var(--cg-primary, #c639b8) !important; }

/* Emoji picker: anclado al input */
#cgEmojiPicker { box-shadow: 0 -8px 32px rgba(0,0,0,.4); }

/* ══════════════════════════════════════════════════════════════
   CS/S — Rediseño: botón volver + pestañas + tarjeta ancha
══════════════════════════════════════════════════════════════ */

/* Header CS/S */
.css-header__top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 0;
}

/* Pestañas */
.css-wrap {
  padding: 10px 12px 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; /* necesario para flex:1 con overflow */
}
.css-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  padding-bottom: 0;
}
.css-tab {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--cg-muted, #888);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--cg-font);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.css-tab--active {
  color: var(--cg-primary, #c639b8);
  border-bottom-color: var(--cg-primary, #c639b8);
}
.css-tab-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(198,57,184,.12);
  color: var(--cg-primary, #c639b8);
}
.css-panel {
  overflow-y: auto;
  /* flex:1 del contenedor ya controla la altura — solo limitar para scroll interno */
  flex: 1;
  min-height: 0; /* necesario para que flex:1 con overflow funcione */
  -webkit-overflow-scrolling: touch;
}

/* ══════════════════════════════════════════════════════════════
   CS/S — TARJETAS PREMIUM DE PRESTIGIO
   Diseño Cyber Neon / Glassmorphism — identidad Globalink
   Variables: --gl-mag #FF00B8 | --gl-cyan #00E5FF | --gl-gold #FFD700
══════════════════════════════════════════════════════════════ */

/* ── Card base ── */
.csp-card {
  position: relative;
  margin: 12px 12px 0;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(139,92,246,0.08) 0%, rgba(0,229,255,0.04) 100%);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.csp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(198,57,184,0.15), 0 2px 8px rgba(0,0,0,0.4);
}
.csp-card:active { transform: translateY(0) scale(0.99); }

/* Brillo superior (cristal) */
.csp-card__shine {
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  pointer-events: none;
  z-index: 1;
}

/* Gradiente de acento en el borde */
.csp-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,0,184,0.04) 0%, transparent 50%, rgba(0,229,255,0.04) 100%);
  border-radius: 22px;
  pointer-events: none;
}

/* ── Header: avatar + identidad ── */
.csp-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 18px 14px;
  position: relative;
  z-index: 1;
}

/* Avatar con anillo animado */
.csp-avatar-wrap {
  position: relative;
  width: 72px; height: 72px;
  flex-shrink: 0;
}
.csp-avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #FF00B8, #8B5CF6, #00E5FF, #3B82F6, #FF00B8);
  animation: cspRingSpin 4s linear infinite;
}
.csp-avatar-ring-inner {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #0B0615;
}
.csp-avatar {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.csp-avatar .cg-av,
.csp-avatar img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
}

@keyframes cspRingSpin {
  to { transform: rotate(360deg); }
}

/* Status dot */
.csp-status-dot {
  position: absolute;
  bottom: 5px; right: 5px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #22c55e;
  border: 2.5px solid #0B0615;
  z-index: 2;
}

/* Identidad */
.csp-identity {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 4px;
}
.csp-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.csp-handle {
  font-size: 12px;
  color: rgba(255,255,255,0.42);
  letter-spacing: 0.2px;
}
.csp-bio {
  font-size: 11px;
  color: rgba(255,255,255,0.38);
  line-height: 1.4;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Bloque de prestigio CTG ── */
.csp-prestige {
  margin: 0 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255,215,0,0.08), rgba(255,215,0,0.03));
  border: 1px solid rgba(255,215,0,0.18);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.csp-prestige::before {
  content: '';
  position: absolute;
  top: -1px; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,215,0,0.4), transparent);
}
.csp-prestige__icon { font-size: 22px; flex-shrink: 0; }
.csp-prestige__info { flex: 1; min-width: 0; }
.csp-prestige__level {
  font-size: 15px;
  font-weight: 700;
  color: #FFD700;
  line-height: 1.1;
}
.csp-prestige__tier {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,215,0,0.5);
  margin-top: 1px;
}
.csp-trophy-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,215,0,0.22);
  background: rgba(255,215,0,0.08);
  color: #FFD700;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .12s, background .12s;
}
.csp-trophy-btn:hover { transform: scale(1.05); background: rgba(255,215,0,0.14); }
.csp-trophy-btn:active { transform: scale(0.95); }
.csp-ctg-count { font-size: 11px; font-weight: 700; }
.csp-gems-btn {
  border-color: rgba(0,229,255,0.25);
  background: rgba(0,229,255,0.08);
  color: #00E5FF;
}
.csp-gems-btn:hover { background: rgba(0,229,255,0.16); }
.csp-gems-btn .csp-ctg-count { color: #00E5FF; }

.csp-prestige__rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}
.csp-rank-val {
  font-size: 16px;
  font-weight: 700;
  color: #FFD700;
  line-height: 1;
}
.csp-rank-lbl {
  font-size: 8px;
  color: rgba(255,215,0,0.45);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* ── Stats ── */
.csp-stats {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  margin: 10px 14px 0;
  padding: 10px 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  position: relative;
  z-index: 1;
}
.csp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 2px 4px;
}
.csp-stat__val {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}
.csp-gems-val { color: #00E5FF; }
.csp-stat__lbl {
  font-size: 9px;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.csp-stat__div { background: rgba(255,255,255,0.08); width: 1px; }

/* ── Mini logros ── */
.csp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px 0;
  position: relative;
  z-index: 1;
}
.csp-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid;
  transition: transform .12s;
  cursor: default;
}
.csp-badge:hover { transform: translateY(-1px); }
.csp-badge--gold   { background: rgba(255,215,0,0.08);   border-color: rgba(255,215,0,0.25);   color: #FFD700; }
.csp-badge--silver { background: rgba(192,192,192,0.08); border-color: rgba(192,192,192,0.2);  color: #C0C0C0; }
.csp-badge--bronze { background: rgba(205,127,50,0.08);  border-color: rgba(205,127,50,0.2);   color: #CD7F32; }
.csp-badge--violet { background: rgba(139,92,246,0.10);  border-color: rgba(139,92,246,0.25);  color: #a78bfa; }

/* ── Acciones ── */
.csp-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 16px;
  position: relative;
  z-index: 1;
}
.csp-btn-primary {
  width: 100%;
  padding: 11px 16px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #FF00B8, #8B5CF6, #3B82F6);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: filter .15s, transform .15s;
  position: relative;
  overflow: hidden;
}
.csp-btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transform: skewX(-20deg);
  transition: left .5s ease;
}
.csp-btn-primary:hover::after { left: 150%; }
.csp-btn-primary:hover  { filter: brightness(1.1); transform: translateY(-1px); }
.csp-btn-primary:active { transform: scale(0.98); }

.csp-actions__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.csp-btn-secondary {
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.65);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.csp-btn-secondary:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
  color: #fff;
  transform: translateY(-1px);
}
.csp-btn-secondary:active { transform: scale(0.97); }
.csp-btn-secondary.following {
  background: rgba(0,229,255,0.08);
  border-color: rgba(0,229,255,0.22);
  color: #00E5FF;
}

/* Responsive — pantallas pequeñas */
@media (max-width: 360px) {
  .csp-card { margin: 10px 8px 0; }
  .csp-header { padding: 16px 14px 12px; gap: 10px; }
  .csp-avatar-wrap { width: 60px; height: 60px; }
  .csp-name { font-size: 14px; }
  .csp-actions__row { grid-template-columns: 1fr; }
}

/* ── Reduce motion ── */
@media (prefers-reduced-motion: reduce) {
  .csp-avatar-ring { animation: none; }
  .csp-btn-primary::after { display: none; }
  .csp-card:hover { transform: none; }
}

/* Chats restringidos: ocultos en "Todos" pero presentes en DOM.
   FIX (auditoría de Restringidos — causa raíz final): esta regla tenía
   !important, lo cual hace IMPOSIBLE que un estilo inline normal
   (el.style.display = "") la anule — un !important de hoja de estilos
   siempre gana sobre un inline style no-important, sin excepción. Por eso
   ningún arreglo de JS podía revelar los chats restringidos: el ocultado
   inicial ya lo pone el HTML inline al renderizar (ver UI.renderThreadList,
   style="display:none;" baked into el HTML de cada thread restringido), así
   que esta regla era redundante para ocultar y, con !important, activamente
   dañina para revelar. Se elimina por completo — el JS (UI._reapplyActiveFilter)
   ya controla la visibilidad correctamente vía estilo inline en ambos sentidos. */

/* ══ Grabadora de vídeo — blink del punto REC ══ */
@keyframes cgCamBlink {
  0%,100% { opacity:1; }
  50%      { opacity:0.2; }
}

/* ══ Modo inmersivo de conversación ══ */
/* El JS aplica bottom:0 y z-index:500 via style inline al abrir conv */
/* Este bloque asegura que funcione correctamente en iOS y Android */
/* Nota: el cg-conv-panel.open ya maneja el z-index correcto — no forzar bottom:0 */
.cg-conv-panel[style*="inset:0"] {
  /* Solo para el caso de inset:0 explícito (llamadas) */
  z-index: 500 !important;
}

/* Ocultar el nav badge cuando está en modo inmersivo */
#cgApp.conv-open #cgNav {
  display: none;
}
#cgApp.conv-open #cgHeader {
  display: none;
}

/* ══════════════════════════════════════════════════════════════
   ORBES ENERGÉTICOS DEL NAV — ChatG Premium
   aria-hidden:true en HTML — puramente decorativos
   No interfieren con ninguna lógica de navegación
══════════════════════════════════════════════════════════════ */

/* Keyframes orbes */
@keyframes cgNavOrbCyan {
  from { transform: rotate(0deg) translateX(36px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(36px) rotate(-360deg); }
}
@keyframes cgNavOrbMag {
  from { transform: rotate(180deg) translateX(36px) rotate(-180deg); }
  to   { transform: rotate(-180deg) translateX(36px) rotate(180deg); }
}
@keyframes cgNavOrbGlow {
  0%,100% { opacity:.8; filter: blur(0px); }
  50%      { opacity:1;  filter: blur(1px); }
}

/* ── Sistema de orbes antiguo eliminado — reemplazado por cgn-css-ring ── */

/* Reduce motion: respetar preferencia del usuario */
@media (prefers-reduced-motion: reduce) {
  .cgn-css-ring__track,
  .cgn-css-ring__orb,
  .cgn-p,
  .cg-nav-item.active::after,
  .cg-nav-badge {
    animation: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   CTG SUB-TABS (Ranking / Temporadas)
══════════════════════════════════════════════════════════════ */
.ctg-subtab-bar {
  display:flex; gap:8px; padding:12px 16px 0;
  border-bottom:1px solid var(--cg-border);
  background:var(--cg-surface);
  flex-shrink:0;
}
.ctg-subtab {
  padding:8px 18px; border-radius:20px;
  border:1.5px solid var(--cg-border);
  background:transparent; color:var(--cg-muted);
  font-size:12px; font-weight:700; cursor:pointer;
  font-family:inherit; transition:.15s;
}
.ctg-subtab:hover { border-color:var(--cg-primary); color:var(--cg-text); }
.ctg-subtab--active { background:var(--cg-primary); color:#fff; border-color:transparent; }

/* ══ Temporadas ══ */
.ctg-seasons-wrap {
  padding:12px 16px; overflow-y:auto;
  display:flex; flex-direction:column; gap:10px;
}
.ctg-seasons-loading {
  display:flex; align-items:center; gap:10px;
  justify-content:center; padding:40px 0;
  color:var(--cg-muted); font-size:13px;
}
.ctg-seasons-empty {
  text-align:center; padding:40px 16px;
  color:var(--cg-muted); font-size:13px;
}
.ctg-season-card {
  background:var(--cg-surface);
  border:1px solid var(--cg-border);
  border-radius:16px; overflow:hidden;
  cursor:pointer; transition:.15s;
}
.ctg-season-card:hover {
  border-color:rgba(198,57,184,.4);
  box-shadow:0 0 18px rgba(198,57,184,.12);
  transform:translateY(-1px);
}
.ctg-season-card__header {
  display:flex; align-items:center; gap:12px; padding:14px 16px;
}
.ctg-season-card__icon { font-size:24px; flex-shrink:0; }
.ctg-season-card__info { flex:1; }
.ctg-season-card__title { font-size:15px; font-weight:800; color:var(--cg-text); }
.ctg-season-card__dates { font-size:11px; color:var(--cg-muted); margin-top:2px; }
.ctg-season-card__arrow { color:var(--cg-muted); font-size:13px; }

/* ══ Detalle de temporada ══ */
.ctg-season-detail-header {
  display:flex; align-items:center; gap:12px;
  padding:12px 16px; border-bottom:1px solid var(--cg-border);
  flex-shrink:0;
}
.ctg-season-back-btn {
  background:none; border:none; color:var(--cg-primary);
  font-size:13px; font-weight:700; cursor:pointer;
  font-family:inherit; display:flex; align-items:center; gap:6px;
  padding:6px 0;
}
.ctg-season-detail-title {
  font-size:16px; font-weight:800; color:var(--cg-text);
}
.ctg-season-cats {
  padding:12px 16px; overflow-y:auto;
  display:flex; flex-direction:column; gap:16px;
}
.ctg-season-cat-block {
  background:var(--cg-surface);
  border:1px solid var(--cg-border);
  border-radius:16px; overflow:hidden;
}
.ctg-season-cat-title {
  padding:12px 16px; font-size:14px; font-weight:800;
  color:var(--cg-text);
  border-bottom:1px solid var(--cg-border);
  background:rgba(255,255,255,.02);
}

/* ══ Tarjetas de ganadores ══ */
.ctg-winner-card {
  display:flex; align-items:center; gap:12px;
  padding:12px 16px;
  border-bottom:1px solid var(--cg-border);
  transition:background .15s;
}
.ctg-winner-card:last-child { border-bottom:none; }
.ctg-winner-card:hover { background:rgba(255,255,255,.025); }
.ctg-winner-card__place { font-size:22px; flex-shrink:0; width:28px; text-align:center; }
.ctg-winner-card__av { flex-shrink:0; }
.ctg-winner-card__info { flex:1; min-width:0; }
.ctg-winner-card__name { font-size:13px; font-weight:700; color:var(--cg-text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ctg-winner-card__user { font-size:11px; color:var(--cg-muted); }
.ctg-winner-card__gems { font-size:11px; color:#f5c800; margin-top:2px; }
.ctg-winner-card__actions { flex-shrink:0; }
.ctg-winner-follow-btn {
  padding:6px 14px; border-radius:20px;
  border:1.5px solid var(--cg-primary); background:transparent;
  color:var(--cg-primary); font-size:11px; font-weight:700;
  cursor:pointer; font-family:inherit; transition:.15s;
  display:flex; align-items:center; gap:5px;
}
.ctg-winner-follow-btn.following {
  background:rgba(198,57,184,.15); border-color:rgba(198,57,184,.4);
  color:var(--cg-text);
}
.ctg-winner-follow-btn:hover { opacity:.85; }
.ctg-winner-follow-btn:disabled { opacity:.5; cursor:default; }

/* ══ Botón follow en tarjetas CS/S ══ */
.css-follow-btn {
  width:34px; height:34px; border-radius:50%;
  border:1.5px solid var(--cg-border);
  background:transparent; color:var(--cg-muted);
  display:flex; align-items:center; justify-content:center;
  font-size:14px; cursor:pointer; transition:.15s; flex-shrink:0;
}
.css-follow-btn:hover { border-color:var(--cg-primary); color:var(--cg-primary); }
.css-follow-btn.following {
  background:rgba(198,57,184,.15);
  border-color:rgba(198,57,184,.5);
  color:#c639b8;
}
.css-follow-btn:disabled { opacity:.5; cursor:default; }

/* ══════════════════════════════════════════════════════════════
   NAV — OCULTAMIENTO AUTOMÁTICO
   Se oculta cuando el panel de conversación o llamada está activo.
   Sin tocar chatg.js — CSS puro con :has() + transición suave.
══════════════════════════════════════════════════════════════ */

/* El panel móvil cubre la lista. En escritorio convive con la navegación. */
@media (max-width:767px) {
    #cgApp:has(#cgConvPanel:not([style*="display:none"]):not([style*="display: none"])) #cgNav,
    #cgApp:has(#cgConvPanel.active) #cgNav {
        opacity:0;pointer-events:none;transform:translateY(100%);
    }
}
#cgApp:has(#cgCallOverlay:not([style*="display:none"]):not([style*="display: none"])) #cgNav,
#cgApp:has(#cgCallOverlay.active) #cgNav {
    opacity:0;pointer-events:none;transform:translateY(100%);
}

/* Estado visible: transición de entrada — consolidado en .cg-nav */

/* Fallback para navegadores sin :has() — clase .cg-nav--hidden añadida por JS si hace falta */
#cgNav.cg-nav--hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(100%) !important;
}

/* ══════════════════════════════════════════════════════════════
   PANEL DE TEMA DE FONDO — ChatG
   Selector de gradientes y modos sincronizado con Globalink
══════════════════════════════════════════════════════════════ */

/* Panel deslizante desde abajo */
.cgbt-panel {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 850;
  background:linear-gradient(150deg,#182840,#101a2e 55%,#151b32);
  color:#f1f5ff;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border:1px solid #4d648a;
  box-shadow:0 0 26px #47b3ed25;
  border-radius: 22px 22px 0 0;
  max-height:72dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform .26s cubic-bezier(.4,0,.2,1);
  padding-bottom: env(safe-area-inset-bottom);
}
.cgbt-panel--open {
  transform: translateY(0);
}

/* Handle de arrastre */
.cgbt-handle {
  width: 36px; height: 4px;
  background:#87bdd16e;
  border-radius: 2px;
  margin: 10px auto 0;
}

/* Header del panel */
.cgbt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
}
.cgbt-title {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5ff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cgbt-title i { color: #a3edff; }

.cgbt-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  border:1px solid #4d648a;
  background:#1b2c49;
  color: #c0cfe6;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.cgbt-close:hover { background: rgba(255,255,255,.14); color: #f1f5ff; }

/* Body del panel */
.cgbt-body {
  padding: 4px 16px 20px;
}

/* Título de sección */
.cgbt-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #c0cfe6;
  margin: 14px 0 8px;
}

/* Grid de swatches */
.cgbt-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

/* Swatch individual */
.cgbt-swatch {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 2.5px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 5px;
  overflow: hidden;
  transition: transform .14s, border-color .14s, box-shadow .14s;
  -webkit-tap-highlight-color: transparent;
}
.cgbt-swatch:hover {
  transform: scale(1.06);
}
.cgbt-swatch:active {
  transform: scale(.94);
}
.cgbt-swatch--active {
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.3), 0 4px 16px rgba(0,0,0,.5);
  transform: scale(1.08);
}

/* Label dentro del swatch */
.cgbt-swatch-label {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
  pointer-events: none;
}

/* Responsive: más columnas en pantallas más anchas */
@media (min-width: 400px) {
  .cgbt-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 768px) {
  .cgbt-panel { left: auto; width: 380px; right: 8px; border-radius: 18px; bottom: 8px; }
  .cgbt-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ══════════════════════════════════════════════════════════════
   NUEVAS FEATURES — ChatG
══════════════════════════════════════════════════════════════ */

/* ── Menciones @usuario ── */
.cg-mention { color: var(--cg-primary, #c639b8); font-weight: 600; }
.cg-mention--me { background: rgba(198,57,184,.15); border-radius: 4px; padding: 1px 3px; }

.cg-mention-box {
  position: fixed;
  background: var(--cg-bg2, #0f0f1e);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(16px);
  max-height: 220px;
  overflow-y: auto;
}
.cg-mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .12s;
}
.cg-mention-item:hover { background: rgba(255,255,255,.07); }
.cg-mention-info { display: flex; flex-direction: column; gap: 1px; }
.cg-mention-name { font-size: 13px; font-weight: 600; color: var(--cg-text); }
.cg-mention-handle { font-size: 11px; color: var(--cg-muted); }

/* ── Documento / File bubble ── */
.cg-doc-bubble {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  text-decoration: none;
  color: var(--cg-text);
  min-width: 200px;
  max-width: 280px;
  transition: background .15s;
}
.cg-doc-bubble:hover { background: rgba(255,255,255,.10); }
.cg-doc-icon { flex-shrink: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.cg-doc-info { flex: 1; min-width: 0; }
.cg-doc-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-doc-ext { font-size: 10px; color: var(--cg-muted); text-transform: uppercase; margin-top: 2px; }

/* ── Link Preview ── */
.cg-link-preview-wrap { margin-top: 6px; }
.cg-link-preview {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--cg-text);
  background: rgba(255,255,255,.04);
  transition: background .15s;
  max-width: 300px;
}
.cg-link-preview:hover { background: rgba(255,255,255,.08); }
.cg-link-preview-img { width: 100%; height: 140px; object-fit: cover; }
.cg-link-preview-body { padding: 8px 12px 10px; }
.cg-link-preview-domain { font-size: 10px; color: var(--cg-primary, #c639b8); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
.cg-link-preview-title { font-size: 13px; font-weight: 700; line-height: 1.3; }
.cg-link-preview-desc { font-size: 11px; color: var(--cg-muted); margin-top: 3px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Mensajes temporales (auto-destrucción) ── */
.cg-expire-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: #f59e0b;
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 20px;
  padding: 2px 7px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 600;
}








.cg-messages--doodle-default {
  background-color: #10171b;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMzAiIGhlaWdodD0iMTMwIiB2aWV3Qm94PSIwIDAgMTMwIDEzMCI+CjxyZWN0IHdpZHRoPSIxMzAiIGhlaWdodD0iMTMwIiBmaWxsPSIjMTAxNzFiIi8+CjxnIHN0cm9rZT0iIzZiNzc4MCIgc3Ryb2tlLXdpZHRoPSIxLjMiIGZpbGw9Im5vbmUiIG9wYWNpdHk9IjAuMjIiPgo8cGF0aCBkPSJNOCAxMCBxMCAtNSA1IC01IGg5IHE1IDAgNSA1IHY3IHEwIDUgLTUgNSBoLTYgbC0zLjUgMy41IHYtMy41IGgwIHEtNC41IDAgLTQuNSAtNSB6Ii8+CjwvZz4KPGcgc3Ryb2tlPSIjNmI3NzgwIiBzdHJva2Utd2lkdGg9IjEuMiIgZmlsbD0ibm9uZSIgb3BhY2l0eT0iMC4yMiI+CjxwYXRoIGQ9Ik01MiA2IGwyIDQuNCA0LjggMC42IC0zLjUgMy40IDAuOSA0LjggLTQuMiAtMi4zIC00LjIgMi4zIDAuOSAtNC44IC0zLjUgLTMuNCA0LjggLTAuNiB6Ii8+CjwvZz4KPGcgc3Ryb2tlPSIjNmI3NzgwIiBzdHJva2Utd2lkdGg9IjEuMyIgZmlsbD0ibm9uZSIgb3BhY2l0eT0iMC4yMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj4KPHBhdGggZD0iTTkyIDIyIHEwIC04IDUgLTEwIHEtMiA1IDAgOSBxNCAtMSA2IC01IHEwIDcgLTUgMTAgcTMgMSA2IDAgcS00IDQgLTkgMyBxLTMgLTEgLTMgLTcgeiIvPgo8L2c+CjxnIHN0cm9rZT0iIzZiNzc4MCIgc3Ryb2tlLXdpZHRoPSIxLjMiIGZpbGw9Im5vbmUiIG9wYWNpdHk9IjAuMjIiPgo8cGF0aCBkPSJNMTYgNjUgcS0zLjUgLTYuNSAzIC05IHE0IC0xLjYgNi41IDMgcTIuNSAtNC42IDYuNSAtMyBxNi41IDIuNSAzIDkgcS00IDYuNSAtOS41IDExIHEtNS41IC00LjUgLTkuNSAtMTEgeiIvPgo8L2c+CjxnIHN0cm9rZT0iIzZiNzc4MCIgc3Ryb2tlLXdpZHRoPSIxLjIiIGZpbGw9Im5vbmUiIG9wYWNpdHk9IjAuMiI+CjxjaXJjbGUgY3g9IjU4IiBjeT0iNjIiIHI9IjYuNSIvPgo8cGF0aCBkPSJNNTggNTJ2M001OCA2OXYzTTQ1IDYyaDNNNjcgNjJoM000OC41IDUyLjVsMiAyTTY3LjUgNTIuNWwtMiAyTTQ4LjUgNzEuNWwyLTJNNjcuNSA3MS41bC0yLTIiLz4KPC9nPgo8ZyBzdHJva2U9IiM2Yjc3ODAiIHN0cm9rZS13aWR0aD0iMS4zIiBmaWxsPSJub25lIiBvcGFjaXR5PSIwLjIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHRyYW5zZm9ybT0icm90YXRlKC0xNCAxMDAgNjIpIj4KPHBhdGggZD0iTTEwMiA1MCBsLTggMTAgaDUuNSBsLTIgOSA5IC0xMCBoLTUuNSB6Ii8+CjwvZz4KPGcgc3Ryb2tlPSIjNmI3NzgwIiBzdHJva2Utd2lkdGg9IjEuMyIgZmlsbD0ibm9uZSIgb3BhY2l0eT0iMC4yIj4KPHJlY3QgeD0iOSIgeT0iOTUiIHdpZHRoPSIyMCIgaGVpZ2h0PSIxNCIgcng9IjIiLz4KPGNpcmNsZSBjeD0iMTkiIGN5PSIxMDIiIHI9IjQuMyIvPgo8cmVjdCB4PSIyMiIgeT0iOTIiIHdpZHRoPSI1IiBoZWlnaHQ9IjMuNSIgcng9IjAuOCIvPgo8L2c+CjxnIHN0cm9rZT0iIzZiNzc4MCIgc3Ryb2tlLXdpZHRoPSIxLjMiIGZpbGw9Im5vbmUiIG9wYWNpdHk9IjAuMjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgdHJhbnNmb3JtPSJyb3RhdGUoMjAgNjAgMTAyKSI+CjxwYXRoIGQ9Ik00OCAxMDggbDI3IC0xMCAtMTAgMjcgLTUgLTEyLjUgeiIvPgo8L2c+CjxnIHN0cm9rZT0iIzZiNzc4MCIgc3Ryb2tlLXdpZHRoPSIxLjMiIGZpbGw9Im5vbmUiIG9wYWNpdHk9IjAuMiI+CjxyZWN0IHg9IjkyIiB5PSI5MiIgd2lkdGg9IjIwIiBoZWlnaHQ9IjE3IiByeD0iMS41Ii8+CjxwYXRoIGQ9Ik05MiA5OS41IGgyMCBNMTAyIDkyIHYxNyBNOTcgOTIgcTAgLTUgNSAtNSBxNSAwIDUgNSIvPgo8L2c+CjxnIHN0cm9rZT0iIzZiNzc4MCIgc3Ryb2tlLXdpZHRoPSIxLjIiIGZpbGw9Im5vbmUiIG9wYWNpdHk9IjAuMTgiPgo8Y2lyY2xlIGN4PSI0MiIgY3k9IjIyIiByPSI2Ii8+CjxwYXRoIGQ9Ik0zOSAyMy41IHEzIDMgNiAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KPGNpcmNsZSBjeD0iNDAiIGN5PSIyMC41IiByPSIwLjciIGZpbGw9IiM2Yjc3ODAiLz4KPGNpcmNsZSBjeD0iNDQiIGN5PSIyMC41IiByPSIwLjciIGZpbGw9IiM2Yjc3ODAiLz4KPC9nPgo8ZyBmaWxsPSIjNmI3NzgwIiBvcGFjaXR5PSIwLjE2Ij4KPGNpcmNsZSBjeD0iNSIgY3k9IjQwIiByPSIyIi8+CjxjaXJjbGUgY3g9IjguNSIgY3k9IjM3IiByPSIxLjIiLz4KPGNpcmNsZSBjeD0iMyIgY3k9IjM1LjUiIHI9IjAuOSIvPgo8L2c+CjxnIGZpbGw9IiM2Yjc3ODAiIG9wYWNpdHk9IjAuMTYiPgo8Y2lyY2xlIGN4PSI0MCIgY3k9IjQwIiByPSIxLjgiLz4KPGNpcmNsZSBjeD0iNDMiIGN5PSIzNy41IiByPSIxLjEiLz4KPC9nPgo8ZyBmaWxsPSIjNmI3NzgwIiBvcGFjaXR5PSIwLjE2Ij4KPGNpcmNsZSBjeD0iODEiIGN5PSIyOCIgcj0iMiIvPgo8Y2lyY2xlIGN4PSI3OCIgY3k9IjMyIiByPSIxLjEiLz4KPC9nPgo8ZyBzdHJva2U9IiM2Yjc3ODAiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgb3BhY2l0eT0iMC4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiPgo8cGF0aCBkPSJNMTE4IDM1IGwwIDYgTTExNSAzOCBsNiAwIE0xMTYgMzYgbDQgNCBNMTIwIDM2IGwtNCA0Ii8+CjwvZz4KPGcgc3Ryb2tlPSIjNmI3NzgwIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIG9wYWNpdHk9IjAuMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj4KPHBhdGggZD0iTTggODUgbDAgNiBNNSA4OCBsNiAwIE02IDg2IGw0IDQgTTEwIDg2IGwtNCA0Ii8+CjwvZz4KPGcgc3Ryb2tlPSIjNmI3NzgwIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIG9wYWNpdHk9IjAuMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj4KPHBhdGggZD0iTTgwIDgyIGwwIDYgTTc3IDg1IGw2IDAgTTc4IDgzIGw0IDQgTTgyIDgzIGwtNCA0Ii8+CjwvZz4KPGcgc3Ryb2tlPSIjNmI3NzgwIiBzdHJva2Utd2lkdGg9IjEuMiIgZmlsbD0ibm9uZSIgb3BhY2l0eT0iMC4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPgo8cGF0aCBkPSJNNjUgNSBsOCAwIE03MCAyLjUgbDMgMi41IGwtMyAyLjUiLz4KPC9nPgo8ZyBzdHJva2U9IiM2Yjc3ODAiIHN0cm9rZS13aWR0aD0iMS4yIiBmaWxsPSJub25lIiBvcGFjaXR5PSIwLjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgdHJhbnNmb3JtPSJyb3RhdGUoMTM1IDEyMiA4MCkiPgo8cGF0aCBkPSJNMTE4IDgwIGw4IDAgTTEyMyA3Ny41IGwzIDIuNSBsLTMgMi41Ii8+CjwvZz4KPGcgc3Ryb2tlPSIjNmI3NzgwIiBzdHJva2Utd2lkdGg9IjEuMiIgZmlsbD0ibm9uZSIgb3BhY2l0eT0iMC4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHRyYW5zZm9ybT0icm90YXRlKDEyMCAzOCA4OCkiPgo8cGF0aCBkPSJNMzQgODggbDggMCBNMzkgODUuNSBsMyAyLjUgbC0zIDIuNSIvPgo8L2c+Cjwvc3ZnPgo=");
  background-repeat: repeat;
  background-size: 130px 130px;
  background-attachment: local;
}

/* ══════════════════════════════════════════════════════
   Selector de fondo de chat v2 — vista previa + swipe + brillo
══════════════════════════════════════════════════════ */
.cg-bg-preview {
  position: relative;
  height: 190px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
  background-color: var(--cg-bg-color, #07070f);
  background-image: var(--cg-bg-layer, none);
  background-size: var(--cg-bg-size, cover);
  background-repeat: var(--cg-bg-repeat, no-repeat);
  background-position: center center;
  transition: background-color .15s ease;
}
.cg-bg-preview-bubble {
  position: absolute; max-width: 70%; padding: 7px 11px; border-radius: 14px;
  font-size: 12px; line-height: 1.35; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.cg-bg-preview-bubble.them {
  left: 10px; top: 14px; background: rgba(255,255,255,.14); color: #fff;
  border-bottom-left-radius: 4px;
}
.cg-bg-preview-bubble.me {
  right: 10px; top: 54px; background: var(--cg-grad); color: #fff;
  border-bottom-right-radius: 4px;
}

.cg-brightness-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.cg-brightness-row i { color: var(--cg-muted); font-size: 13px; width: 16px; text-align: center; }
.cg-brightness-slider {
  flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, #000, var(--cg-border) 50%, #fff);
  outline: none;
}
.cg-brightness-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--cg-primary); border: 2px solid #fff; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.cg-brightness-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--cg-primary);
  border: 2px solid #fff; cursor: pointer;
}

.cg-bg-swipe-row {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity;
  padding-bottom: 4px; margin-bottom: 14px; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cg-bg-swipe-row::-webkit-scrollbar { display: none; }
.cg-bg-swatch-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex-shrink: 0; scroll-snap-align: start; width: 64px;
}
.cg-bg-swatch {
  width: 64px; height: 64px; border-radius: 12px;
  cursor: pointer; border: 2.5px solid transparent; transition: border-color .15s, transform .1s;
  background-size: cover; background-position: center;
}
.cg-bg-swatch.selected { border-color: var(--cg-primary); transform: scale(1.04); }
.cg-bg-swatch-label {
  font-size: 9px; text-align: center; color: var(--cg-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 64px;
}

/* ══════════════════════════════════════════════════════
   Color de burbujas v1 — sólido o degradado, por chat
══════════════════════════════════════════════════════ */
.cg-bubble-mode-row { display: flex; gap: 8px; margin-bottom: 14px; }
.cg-bubble-mode-btn {
  flex: 1; padding: 9px; border-radius: 12px; text-align: center; font-size: 13px;
  font-weight: 600; cursor: pointer; border: 1.5px solid var(--cg-border);
  background: rgba(255,255,255,.04); color: var(--cg-muted); transition: all .15s;
}
.cg-bubble-mode-btn.active { border-color: var(--cg-primary); color: #fff; background: rgba(198,57,184,.14); }
.cg-bubble-swatch-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cg-bubble-swatch {
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  border: 2.5px solid transparent; transition: border-color .15s, transform .1s;
}
.cg-bubble-swatch.selected { border-color: #fff; transform: scale(1.12); box-shadow: 0 0 0 2px var(--cg-primary); }
.cg-bubble-custom-pickers { display: flex; gap: 10px; align-items: center; }
.cg-bubble-custom-pickers input[type="color"] {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--cg-border);
  background: none; cursor: pointer; padding: 0;
}

/* ══════════════════════════════════════════════════════
   Galería de fondos ("Fondos") — fotos generadas, por categoría
══════════════════════════════════════════════════════ */
.cg-wgallery-sheet {
  position: fixed; inset: 0; z-index: 900; background: var(--cg-bg, #07070f);
  display: flex; flex-direction: column;
}
.cg-wgallery-header {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--cg-border); flex-shrink: 0;
}
.cg-wgallery-header h3 { font-size: 16px; margin: 0; }
.cg-wgallery-close {
  background: rgba(255,255,255,.06); border: none; color: var(--cg-text);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px;
}
.cg-wgallery-body { flex: 1; overflow-y: auto; padding: 14px 16px 30px; }
.cg-wgallery-cat-label {
  font-size: 13px; font-weight: 700; color: var(--cg-muted); margin: 18px 0 10px;
  text-transform: uppercase; letter-spacing: .03em;
}
.cg-wgallery-cat-label:first-child { margin-top: 0; }
.cg-wgallery-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.cg-wgallery-thumb {
  aspect-ratio: 9/16; border-radius: 12px; object-fit: cover; cursor: pointer;
  border: 2px solid transparent; transition: border-color .15s, transform .1s;
  width: 100%; display: block; background: var(--cg-bg3);
}
.cg-wgallery-thumb:active { transform: scale(0.96); }
.cg-wgallery-thumb.selected { border-color: var(--cg-primary); }

/* ══════════════════════════════════════════════════════
   Llamadas — header propio con búsqueda y ajustes
══════════════════════════════════════════════════════ */
.calls-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 6px;
}
.calls-header__title { font-size: 18px; font-weight: 700; }
.calls-header__actions { display: flex; gap: 4px; }

/* ══════════════════════════════════════════════════════
   Story Studio — recorte, texto, stickers, dibujo, filtros
══════════════════════════════════════════════════════ */
.cg-sq-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px 12px;
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(rgba(0,0,0,.55), transparent);
}
.cg-sq-btn {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  padding: 8px 18px; border-radius: 20px; font-family: var(--cg-font);
  font-size: 14px; cursor: pointer;
}
.cg-sq-btn--primary { background: var(--cg-grad); font-weight: 700; }
.cg-sq-counter { color: #fff; font-size: 13px; font-weight: 600; }

.cg-sq-toolbar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 5;
  padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 14px);
  display: flex; justify-content: center; gap: 22px;
  background: linear-gradient(transparent, rgba(0,0,0,.5));
}
.cg-sq-tool {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; color: #fff; cursor: pointer; font-family: var(--cg-font);
}
.cg-sq-tool i { font-size: 19px; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; }
.cg-sq-tool span { font-size: 10px; color: rgba(255,255,255,.8); }

/* Editor de capas (Story Studio) */
.cg-studio-canvas-wrap { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cg-studio-layer-text {
  position: absolute; cursor: move; touch-action: none; padding: 4px 8px;
  white-space: nowrap; user-select: none; transform-origin: center center;
}
.cg-studio-draw-canvas { position: absolute; inset: 0; touch-action: none; }
.cg-studio-filter-row { display: flex; gap: 12px; overflow-x: auto; padding: 12px 16px; }
.cg-studio-filter-row::-webkit-scrollbar { display: none; }
.cg-studio-filter-item { display: flex; flex-direction: column; align-items: center; gap: 5px; flex-shrink: 0; cursor: pointer; }
.cg-studio-filter-thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; border: 2.5px solid transparent; background: var(--cg-bg3); }
.cg-studio-filter-item.active .cg-studio-filter-thumb { border-color: var(--cg-primary); }
.cg-studio-filter-item span { font-size: 10px; color: rgba(255,255,255,.8); }
.cg-studio-color-row { display: flex; gap: 10px; padding: 10px 16px; flex-wrap: wrap; justify-content: center; }
.cg-studio-color-dot { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2.5px solid transparent; }
.cg-studio-color-dot.active { border-color: #fff; transform: scale(1.15); }
.cg-studio-sticker-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 12px 16px; max-height: 32vh; overflow-y: auto; }
.cg-studio-sticker-item { font-size: 26px; text-align: center; padding: 6px 0; cursor: pointer; border-radius: 10px; }
.cg-studio-sticker-item:active { background: rgba(255,255,255,.12); }

/* ══════════════════════════════════════════════════════
   Burbuja de respuesta a historia (punto 2)
══════════════════════════════════════════════════════ */
.cg-story-reply-bubble { cursor: pointer; width: 180px; }
.cg-story-reply-thumb {
  position: relative; width: 100%; height: 130px; border-radius: 12px;
  overflow: hidden; background: var(--cg-bg3);
}
.cg-story-reply-thumb img, .cg-story-reply-thumb video {
  width: 100%; height: 100%; object-fit: cover;
}
.cg-story-reply-badge {
  position: absolute; bottom: 6px; left: 6px; font-size: 10px; font-weight: 700;
  color: #fff; background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 10px;
}
.cg-story-reply-text { font-size: 13px; margin-top: 6px; word-break: break-word; }

/* ══════════════════════════════════════════════════════
   Historias — tipos nuevos: texto, audio, música
══════════════════════════════════════════════════════ */
.cg-stype-sheet { position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.cg-stype-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px; }
.cg-stype-item { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.cg-stype-icon {
  width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center;
  justify-content: center; font-size: 22px; background: var(--cg-grad); color: #fff;
}
.cg-stype-item span { font-size: 11px; color: var(--cg-text); text-align: center; }

.cg-text-story-editor { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; }
.cg-text-story-canvas { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; overflow: hidden; }
.cg-text-story-input {
  width: 100%; background: transparent; border: none; outline: none; resize: none;
  color: #fff; text-align: center; font-size: 30px; line-height: 1.3;
  text-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.cg-text-story-input::placeholder { color: rgba(255,255,255,.55); }
.cg-bg-palette-row { display: flex; gap: 10px; padding: 12px 16px; overflow-x: auto; }
.cg-bg-palette-row::-webkit-scrollbar { display: none; }
.cg-bg-palette-dot {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  border: 2.5px solid transparent;
}
.cg-bg-palette-dot.active { border-color: #fff; transform: scale(1.12); }
.cg-font-row { display: flex; gap: 10px; padding: 10px 16px; overflow-x: auto; }
.cg-font-row::-webkit-scrollbar { display: none; }
.cg-font-item {
  flex-shrink: 0; padding: 8px 14px; border-radius: 14px; background: rgba(255,255,255,.1);
  color: #fff; font-size: 14px; cursor: pointer; border: 1.5px solid transparent; white-space: nowrap;
}
.cg-font-item.active { border-color: var(--cg-primary); background: rgba(198,57,184,.25); }

.cg-audio-story-editor { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
.cg-audio-record-btn {
  width: 84px; height: 84px; border-radius: 50%; border: 4px solid #fff; background: #ef4444;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px; cursor: pointer;
}
.cg-audio-record-btn.recording { animation: cgPulse 1s ease-in-out infinite; }
.cg-audio-waveform-icon { font-size: 64px; color: rgba(255,255,255,.85); }

/* ChatG en el Feed. Las reglas :host solo se aplican a las raíces montadas allí. */
:host {
    color:#f3f6ff;
    font-family:var(--cg-font);
    color-scheme:dark;
}
:host(.feed-community-content) #cgMain {
    width:100%;
    max-width:none;
    min-width:0;
    min-height:0;
    padding:10px 14px 18px;
    border:0;
    background:transparent;
    overscroll-behavior:contain;
    touch-action:pan-y pinch-zoom;
}
:host .css-panel:not([style*="display:none"]) {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(min(270px,100%),1fr));
    align-items:start;
    gap:12px;
    overflow:visible;
}
:host .css-card__loading, :host .css-empty { grid-column:1 / -1; }
:host .csp-card { margin:0; }
:host :is(.css-wrap,.css-header,.ctg-wrap) { padding-inline:0; }
:host .css-header__top { padding:0; }
:host .css-intro {
    flex:1;
    margin:0 0 10px;
    background:#ffffff08;
    border-color:#9ec9ff38;
}
:host .css-intro__row { justify-content:flex-start; }
:host .css-intro span { color:#d9e5fb; font-size:13px; line-height:1.55; text-align:start; }
:host .css-intro strong {
    background:none;
    color:#e5f2ff;
    -webkit-text-fill-color:currentColor;
}
:host .css-intro span strong { font-size:inherit; }

:host :is(.css-tab,.ctg-subtab,.ctg-cta-btn) { min-height:44px; touch-action:manipulation; }
:host .css-tab { border-radius:12px; color:#dbe8ff; background:#172341; }
:host .css-tab--active { background:linear-gradient(120deg,#14638e,#7526aa); color:white; }
:host .ctg-lb-list[hidden] { display:none; }
:host .cg-toast-container { z-index:11000; }
:host .ctg-banner {
    min-height:0;
    background:var(--ctg-vitrine-background);
}
:host .ctg-banner__bg { display:none; }
:host .ctg-banner__content { padding:20px; max-width:70%; }
:host .ctg-banner__title--accent { background:none; -webkit-text-fill-color:#a8eaff; color:#a8eaff; }
:host .ctg-banner__desc { color:#d8e6ff; margin-bottom:14px; }
:host .ctg-banner__cta-row { margin-bottom:0; }
:host .ctg-feed-trophy {
    position:absolute;
    inset:50% 4% auto auto;
    transform:translateY(-50%);
    width:min(25%,160px);
    filter:drop-shadow(0 5px 12px #eea74566);
}
@media (max-width:520px) {
    :host .ctg-banner__content { padding:16px; max-width:100%; }
    :host .ctg-banner__title { max-width:80%; }
    :host .ctg-feed-trophy { inset:12px 8px auto auto; transform:none; width:min(21%,72px); }
    :host .ctg-cta-btn { padding-inline:12px; }
}

/* Ranking y Temporadas comparten el área desplazable de CTG. */
.ctg-main .ctg-subtab-bar {
    position:sticky;top:0;z-index:2;gap:8px;flex-wrap:wrap;
    padding:0 0 10px;background:var(--ctg-vitrine-background,#141830);
}
.ctg-main .ctg-subtab { min-height:38px;color:#dfecff;border-color:#4e678e; }
.ctg-main .ctg-subtab--active { background:linear-gradient(125deg,#176082,#443587);border-color:#83d8f7; }
.ctg-main .ctg-seasons-wrap { padding:13px 0 4px;overflow:visible;min-width:0;gap:11px; }
.ctg-main .ctg-seasons-title { font-size:18px;color:#eff4ff;margin:2px 0; }
.ctg-main .ctg-season-card {
    flex:none;width:100%;min-width:0;display:block;text-align:start;
    border-color:#6279a6;background:linear-gradient(120deg,#233756,#30254d);
}
.ctg-season-card__title,.ctg-season-card__dates { display:block;overflow-wrap:anywhere; }
.ctg-main .ctg-season-card__dates { color:#c2d1e9; }
.ctg-main .ctg-season-card__info { min-width:0; }
.ctg-main .ctg-season-cats { min-width:0;padding:11px 0;overflow:visible; }
.ctg-main .ctg-season-detail-header { flex-wrap:wrap;padding-inline:3px; }
.ctg-main .ctg-season-cat-title { overflow-wrap:anywhere; }
.ctg-main :is(.ctg-season-card,.ctg-subtab,.ctg-season-back-btn):focus-visible { outline:2px solid #9de8ff;outline-offset:-3px; }
:host(.feed-community-content) .ctg-wrap { padding-bottom:8px; }
@media (max-width:520px) {
    .ctg-main .ctg-winner-card { flex-wrap:wrap;gap:7px;padding:10px; }
    .ctg-main .ctg-winner-card__info { min-width:min(40%,85px); }
    .ctg-main .ctg-winner-card__user { overflow-wrap:anywhere; }
    .ctg-main .ctg-season-card__header { padding:11px 12px; }
}

/* ChatG Pro: cabecera y navegación compartidas, paneles en una sola cuadrícula. */
#cgNav .cg-pro-nav-icon,.cg-pro-empty { display:none; }
@media (min-width:768px) {
    #cgApp {
        --pro-threads-width:clamp(305px,32vw,410px);
        display:grid;grid-template-columns:var(--pro-threads-width) minmax(0,1fr);
        grid-template-rows:auto auto minmax(0,1fr);gap:0 14px;
        padding:12px max(clamp(14px,2.5vw,38px),calc((100vw - 1760px) / 2));
        background:#121830;
    }
    #cgApp > #cgHeader {
        grid-area:1 / 1 / 2 / -1;display:flex;min-height:52px;padding:8px 14px;
        border:1px solid #50618a;border-radius:15px 15px 0 0;background:#1a2542;
    }
    #cgApp > #cgHeader .cg-header-title { background:none;-webkit-text-fill-color:#eef5ff;color:#eef5ff; }
    #cgApp > #cgHeader .cg-icon-btn {
        border:1px solid #4d6791;border-radius:10px;color:#e0eeff;background:#273652;
    }
    #cgApp > #cgNav {
        grid-area:2 / 1 / 3 / -1;position:static;width:auto;height:auto;min-height:0;display:flex;
        flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;
        padding:8px 12px;margin-bottom:14px;border:1px solid #50618a;border-top:0;
        border-radius:0 0 15px 15px;background:#17213d;transform:none;opacity:1;pointer-events:auto;
    }
    #cgApp > #cgNav .cgn-img-wrap { display:none; }
    #cgApp > #cgNav .cg-nav-item {
        position:relative;inset:auto!important;width:auto;min-width:0;height:auto;min-height:40px;
        justify-content:center;flex-direction:row;gap:7px;padding:7px 12px;
        border-radius:10px;color:#d6e5ff;background:#263653;border:1px solid #4a608a;
    }
    #cgApp > #cgNav .cg-pro-nav-icon { display:inline;color:#a9e1fb; }
    #cgApp > #cgNav .cg-nav-item.active {
        color:#fff;background:linear-gradient(125deg,#145c80,#4a387c);
        border-color:#8ae6ff;box-shadow:inset 0 1px #dcfaff55,0 0 12px #5edbff26;
    }
    #cgApp > #cgNav .cg-nav-item.active::after { content:none; }
    #cgApp > #cgNav .cg-nav-badge { position:static;border:0;animation:none; }
    #cgApp > #cgMain {
        grid-area:3 / 1 / 4 / -1;width:100%;max-width:none;min-width:0;min-height:0;
        padding:14px 16px 20px;border:1px solid #50618a;border-radius:15px;background:#17213ce8;
    }
    #cgApp:is([data-active-tab="chats"],:has(#cgConvPanel.open)) > #cgMain { grid-column:1; }
    #cgApp > #cgConvPanel {
        grid-area:3 / 2 / 4 / 3;position:relative;inset:auto;width:auto;min-height:0;min-width:0;
        overflow:hidden;border:1px solid #53638e;border-radius:15px;background:#152039;
    }
    #cgApp > #cgConvPanel:not(.open) { display:none!important; }
    #cgApp > #cgConvPanel .cg-conv-header { background:#202e4a; }
    #cgApp > #cgConvPanel .cg-conv-info { min-width:0; }
    #cgApp > #cgConvPanel .cg-messages { min-height:0; }
    #cgApp[data-active-tab="chats"]:not(:has(#cgConvPanel.open)) > .cg-pro-empty {
        grid-area:3 / 2 / 4 / 3;display:flex;flex-direction:column;align-items:center;justify-content:center;
        gap:14px;border:1px solid #53638e;border-radius:15px;color:#e0eaff;
        background:radial-gradient(ellipse at 50% 45%,#29335a,transparent 53%),#152039;
    }
    .cg-pro-empty h2 { font-size:16px;font-weight:650; }
    .cg-pro-empty-icon {
        width:56px;height:56px;display:grid;place-items:center;border-radius:17px;font-size:23px;
        color:#9fe9ff;border:1px solid #709dbe;background:linear-gradient(145deg,#244a6c,#3a2c62);
    }
    #cgApp :is(button,a):focus-visible { outline:2px solid #9de8ff;outline-offset:-2px; }
}

/* Aviso de instalación de ChatG Pro */
.cg-install[hidden],
.cg-install-help[hidden] { display:none; }

.cg-install {
  position:fixed;
  z-index:350;
  inset-inline-end:max(16px, env(safe-area-inset-right));
  bottom:calc(var(--cg-nav-h, 64px) + env(safe-area-inset-bottom) + 34px);
  box-sizing:border-box;
  width:min(380px, calc(100% - 32px));
  max-height:calc(100dvh - var(--cg-nav-h, 64px) - 48px);
  overflow:auto;
  padding:18px;
  border:1px solid #75b5f9;
  border-radius:22px;
  background:
    radial-gradient(ellipse at top left, rgba(42, 155, 226, .22), transparent 64%),
    linear-gradient(140deg, rgba(13, 27, 56, .97), rgba(41, 15, 57, .97));
  color:#faf6ff;
  box-shadow:0 0 24px rgba(56, 167, 245, .25),
    0 12px 35px rgba(4, 6, 20, .55), inset 0 1px 1px rgba(222, 241, 255, .35);
  backdrop-filter:blur(16px);
}

.cg-install-heading { display:flex; align-items:center; gap:12px; }
.cg-install-heading img {
  flex:none;
  border-radius:14px;
  border:1px solid rgba(155, 206, 255, .4);
  box-shadow:0 0 18px rgba(43, 191, 241, .28);
}
.cg-install-heading h2 { margin:0 0 4px; font-size:18px; line-height:1.2; }
.cg-install-heading p,
.cg-install-help { margin:0; color:#e2ddf7; font-size:13px; line-height:1.4; }
.cg-install-help {
  margin-top:14px;
  padding:10px 12px;
  background:rgba(223, 236, 255, .08);
  border-radius:10px;
}
.cg-install-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.cg-install-actions button {
  border:1px solid transparent;
  border-radius:12px;
  min-height:44px;
  padding:8px 12px;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}
.cg-install-primary {
  background:linear-gradient(125deg, #81edff, #b1abff 56%, #f6a7f3);
  color:#180c38;
  box-shadow:0 0 16px rgba(149, 128, 246, .4);
}
.cg-install-primary:disabled { opacity:.6; cursor:wait; }
.cg-install-actions .cg-install-secondary {
  background:rgba(208, 225, 255, .12);
  border-color:rgba(208, 225, 255, .33);
  color:#fff;
}
.cg-install-link { background:transparent; color:#e5deff; text-decoration:underline; }
.cg-install-actions button:focus-visible { outline:2px solid #b8f3ff; outline-offset:2px; }

/* ChatG Pro */
#cgApp { background:#090e20; }
#cgApp > #cgNav {
  position:fixed;
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:3px;
  inset:auto 12px calc(env(safe-area-inset-bottom) + 10px);
  z-index:300;
  width:auto;
  min-height:0;
  padding:5px;
  border:1px solid transparent;
  border-radius:21px;
  background:linear-gradient(145deg,#151f36f5,#151426f5) padding-box,
    linear-gradient(125deg,#53c8f9,#596693 56%,#b262b5) border-box;
  box-shadow:0 7px 24px #0009, inset 0 1px #ffffff22;
  backdrop-filter:blur(14px);
}
#cgApp > #cgNav .cg-nav-item {
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  min-width:0;
  width:auto;
  min-height:52px;
  padding:4px 1px;
  border:1px solid transparent;
  border-radius:15px;
  color:#e0e9fb;
  background:transparent;
  cursor:pointer;
}
#cgApp > #cgNav .cg-nav-item:hover { background:#263658; }
#cgApp > #cgNav .cg-nav-item.active { color:#d8f8ff;border-color:#62d3ff;background:#163d64; }
#cgApp > #cgNav .cg-nav-item.active::after { content:none; }
#cgApp > #cgNav .cg-pro-nav-icon { display:block;font-size:19px;color:inherit;line-height:1; }
#cgApp > #cgNav .cg-nav-trophy { width:28px;height:21px;object-fit:contain; }
#cgApp > #cgNav .cg-nav-label { color:inherit;font-size:clamp(9px,2.8vw,11px);font-weight:650;white-space:nowrap; }
#cgApp > #cgNav .cg-nav-badge {
  position:absolute;
  top:2px;
  right:4px;
  min-width:16px;
  padding:1px 3px;
  border-radius:10px;
  background:#a62783;
  color:#fff;
  font-size:10px;
}
#cgApp .cg-main { padding-bottom:calc(96px + env(safe-area-inset-bottom)); }
#cgApp .cg-stories-title { margin:12px 14px 8px;font-size:16px; }
#cgApp .cg-stories-row { gap:8px;padding:0 14px 10px; }
#cgApp .cg-story-item { position:relative; }
#cgApp .cg-story-ring {
  position:relative;
  display:grid;
  place-items:center;
  width:74px;
  height:96px;
  overflow:hidden;
  border:1px solid #5c6f96;
  border-radius:13px;
  background:#1a2944;
  color:#daf4ff;
  cursor:pointer;
}
#cgApp .cg-story-unseen { border:2px solid #68dfff; }
#cgApp .cg-story-ring > img, #cgApp .cg-story-ring .cg-av {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
  border-radius:0;
  object-fit:cover;
}
#cgApp .cg-story-ring .cg-av img { border-radius:0!important; }
#cgApp .cg-story-name {
  position:absolute;
  inset:auto 0 0;
  padding:12px 5px 5px;
  max-width:none;
  color:white;
  background:linear-gradient(transparent,#070d21ef);
  font-size:11px;
  font-weight:650;
}
#cgApp .cg-story-add-btn { right:3px;top:3px;bottom:auto; }
#cgApp .cg-thread-name { font-size:15px; }
#cgApp .cg-thread-preview, #cgApp .cg-conv-status { color:#b9c5dc; }
#cgApp .cg-thread-time { color:#b9c5dc;opacity:1; }
#cgApp .cg-bubble-time { font-size:11px;opacity:.9; }
#cgApp .cg-bubble, #cgApp .cg-msg-input, .cg-size-preview { font-size:var(--cg-text-size,16px); }
#cgApp[data-text-size="small"], .cg-size-preview[data-text-size="small"] { --cg-text-size:14px; }
#cgApp[data-text-size="large"], .cg-size-preview[data-text-size="large"] { --cg-text-size:19px; }
#cgApp :is(.cg-thread-av,.cg-conv-info,.cg-bubble-wrap,.cg-contact-item) .cg-av,
.cg-avatar-image, .cg-profile-photo { border-radius:10px!important; }
.cg-profile-photo { flex-shrink:0;overflow:hidden;padding:0; }
button.cg-profile-photo { cursor:zoom-in; }
.cg-avatar-image, .cg-photo-viewer img { -webkit-touch-callout:none;user-select:none; }
.cg-photo-viewer {
  position:fixed;
  inset:0;
  margin:auto;
  max-width:min(94vw,680px);
  max-height:92dvh;
  padding:12px;
  border:1px solid #6683ad;
  border-radius:18px;
  background:#0c1324;
  color:#fff;
}
.cg-photo-viewer::backdrop { background:#070b15e8; }
.cg-photo-viewer img { display:block;max-width:100%;max-height:72dvh;object-fit:contain;border-radius:10px; }
.cg-photo-viewer button { display:block;margin:0 0 8px auto;width:44px;height:44px;border-radius:12px;background:#273552;color:#fff;font-size:23px;cursor:pointer; }
:is(.cg-pro-contact-overlay,.cg-pro-conv-overlay,.cg-pro-settings-overlay) > div {
  background:#0b1225!important;
  max-height:calc(100dvh - env(safe-area-inset-top) - 14px)!important;
  padding-bottom:env(safe-area-inset-bottom)!important;
}
.cg-contact-card {
  margin:12px;
  padding:16px;
  text-align:center;
  border:1px solid #465f84;
  border-radius:17px;
  background:#161f37;
}
.cg-contact-card .cg-profile-photo { margin:0 auto 10px; }
.cg-contact-card #cgPpQr { margin-top:14px;border-color:#7768ab!important; }
.cg-contact-quick { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:12px; }
.cg-conv-quick { grid-template-columns:repeat(3,minmax(0,1fr)); }
.cg-contact-quick button, .cg-size-choices button {
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;
  min-height:56px;padding:5px;border:1px solid #52678e;border-radius:12px;
  color:#eff6ff;background:#1a2843;cursor:pointer;font-size:13px;
}
.cg-contact-quick button i { color:#8aeaff;font-size:18px; }
.cg-pro-menu-group {
  margin:12px;
  padding:4px 10px;
  border:1px solid #475d82;
  border-radius:14px;
  background:#151e35;
}
.cg-pro-menu-group h3 { margin:7px 5px 3px;color:#bad6fc;font-size:13px;font-weight:700; }
.cg-pro-menu-row {
  display:flex;align-items:center;gap:10px;width:100%;min-height:44px;
  padding:8px 5px;border-bottom:1px solid #b8d4ff1f;
  color:#f3f6ff;text-align:start;font-size:14px;cursor:pointer;
}
.cg-pro-menu-row:last-child { border-bottom:0; }
.cg-pro-menu-row > i:first-child { width:20px;text-align:center;color:#90e6ff; }
.cg-pro-menu-row > i:last-child:not(:first-child) { margin-inline-start:auto;color:#b7c8e6;font-size:10px; }
.cg-pro-menu-row.cg-pro-menu-danger, .cg-pro-menu-row.cg-pro-menu-danger i { color:#ff949a; }
.cg-pro-menu-row:hover,.cg-contact-quick button:hover { background:#263958; }
.cg-text-size { padding:10px; }
.cg-size-choices { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:8px 0; }
.cg-size-choices button { min-height:44px; }
.cg-size-choices button[aria-pressed="true"] { border-color:#8de4ff;background:#174b74; }
.cg-size-preview { padding:10px;border-radius:10px;background:#253552;color:#fff; }
#cgSaveSize[hidden] { display:none; }
:is(.cg-pro-conv-overlay,.cg-pro-contact-overlay,.cg-pro-settings-overlay,.cg-photo-viewer) button:focus-visible,
#cgApp > #cgNav button:focus-visible { outline:2px solid #9de8ff;outline-offset:-2px; }

@media (min-width:768px) {
  #cgApp { grid-template-rows:auto minmax(0,1fr) auto;row-gap:10px; }
  #cgApp > #cgHeader { border-radius:15px; }
  #cgApp > #cgMain { grid-row:2 / 3; padding-bottom:16px; }
  #cgApp > #cgConvPanel, #cgApp > .cg-pro-empty { grid-row:2 / 4; }
  #cgApp > #cgNav {
    grid-area:3 / 1 / 4 / 2;
    position:relative;
    inset:auto;
    margin:0;
  }
}
@media (min-width:1140px) {
  body:has(> .cg-pro-conv-overlay) #cgApp { right:340px; }
  body > .cg-pro-conv-overlay { justify-content:flex-end!important;align-items:stretch!important;pointer-events:none;background:transparent!important;backdrop-filter:none!important; }
  body > .cg-pro-conv-overlay > div { margin:12px 12px 12px 0;width:328px!important;max-height:none!important;border:1px solid #50638a;border-radius:15px!important;pointer-events:auto; }
}
@media print {
  .cg-avatar-image, .cg-photo-viewer { display:none!important; }
}

.cg-story-progress { position:absolute;inset:4px 5px auto;display:flex;gap:2px; }
.cg-story-progress > span { flex:1;height:2px;border-radius:2px;background:#c4d3ec80; }
.cg-story-progress > .cg-story-progress-new { background:#93edff; }

.cg-story-reply-bubble { display:block; padding:0; border:0; background:transparent; color:inherit; font:inherit; text-align:start; }
.cg-story-gift { flex:0 0 38px; height:38px; border:0; border-radius:50%; background:rgba(255,255,255,.15); color:white; cursor:pointer; }
.cg-support-overlay { position:fixed; inset:0; z-index:900; display:flex; align-items:flex-end; justify-content:center; background:rgba(0,0,0,.5); }
.cg-support-panel { width:100%; max-width:500px; max-height:90dvh; overflow:auto; border-radius:22px 22px 0 0; background:var(--cg-bg2); color:var(--cg-text); }
.cg-support-panel header { display:flex; align-items:center; gap:10px; padding:14px 16px; }
.cg-support-panel h2 { font-size:16px; margin:0; }
.cg-support-panel a { text-decoration:none; }
.cg-support-panel :is(a,summary):focus-visible { outline:2px solid #9de8ff; outline-offset:-2px; }
.cg-support-info summary { cursor:pointer; }
.cg-support-info p { margin:8px 16px 14px; color:var(--cg-muted); }

/* Ajustes secundarios de ChatG Pro */
.cg-avatar-initial, .cg-av:has(> .cg-avatar-initial) { border-radius:10px; }
.cg-avatar-initial { max-width:100%;max-height:100%; }
.cg-aero-sheet > :first-child {
  color:#f1f5ff;
  background:linear-gradient(150deg,#182840,#101a2e 55%,#151b32)!important;
  border:1px solid #4d648a;
  max-height:calc(100dvh - env(safe-area-inset-top) - 14px);
  overflow:auto;
  overscroll-behavior:contain;
  box-shadow:0 0 26px #47b3ed25;
}
.cg-aero-sheet :is(button,select,input,textarea,a,summary):focus-visible,
.cg-policy-dialog button:focus-visible { outline:2px solid #8cedff;outline-offset:-2px; }
.cg-aero-sheet .cg-modal-handle { background:#87bdd16e; }
.cg-aero-sheet :is(select,textarea,input:not([type=range],[type=color],[type=hidden],[type=checkbox])) {
  border:1px solid #577093!important;border-radius:11px!important;
  background:#1b2c49!important;color:#f3f6ff!important;color-scheme:dark;
}
.cg-aero-sheet select option { background:#1b2c49;color:#f3f6ff; }
.cg-aero-sheet :is(.cg-bk-freq-btn,.cg-bubble-mode-btn,.cg-gem-quick,#cgGemCancel,#cgBkClose,
  #cgPasskeySettingsClose,#cgNotifSettingsClose,#cgDisappearCancel) {
  border:1px solid #50698e!important;border-radius:12px!important;color:#e9f2ff!important;
  background:#1b2a44!important;
}
.cg-aero-sheet :is([data-theme],[data-tid],.cg-bubble-swatch,.cgbt-swatch):hover {
  outline:2px solid #68e5ff;outline-offset:1px;
}
.cg-aero-sheet input[type=range] { accent-color:#55dcff; }
.cg-aero-choice {
  display:flex;align-items:center;justify-content:space-between;gap:9px;
  width:100%;min-height:49px;margin-bottom:7px;padding:8px 13px;
  border:1px solid #435574;border-radius:13px;background:#18263f;
  color:#f1f6ff;text-align:start;font-size:14px;cursor:pointer;
}
.cg-font-sample { display:block;margin-top:3px;font-size:13px;color:#bed0eb; }
.cg-aero-sheet [data-theme][aria-pressed=true], .cg-aero-sheet .cg-bg-swatch.selected,
.cg-aero-sheet .cg-bubble-mode-btn.active { outline:2px solid #76e3ff;outline-offset:1px; }
.cg-aero-choice:hover { background:#233858; }
.cg-aero-choice[aria-pressed=true] {
  border-color:transparent;
  background:linear-gradient(150deg,#234368,#212b4b) padding-box,linear-gradient(125deg,#48e5ff,#e252df) border-box;
}
.cg-aero-indicator {
  width:20px;height:20px;flex:none;display:grid;place-items:center;
  border:1px solid #8398b8;border-radius:50%;font-size:10px;
}
.cg-aero-choice[aria-pressed=true] .cg-aero-indicator { color:#06192e;border-color:#75e8ff;background:#75e8ff; }
.cg-aero-sheet :has(> .cg-aero-choice)[style*="padding:8px 0"] { padding-inline:16px!important; }

.cg-privacy-body { padding:12px 13px 20px; }
.cg-privacy-card {
  margin-bottom:12px;padding:10px;
  border:1px solid #465b7d;border-radius:14px;background:#15223a;
}
.cg-privacy-card h3 { margin:0;padding:4px 2px 9px;font-size:14px; }
.cg-privacy-card h3 i { color:#8ee8ff; }
.cg-privacy-row {
  display:grid;grid-template-columns:minmax(0,1fr) minmax(110px,47%);
  align-items:start;gap:8px;padding:8px 0;border-top:1px solid #d0dcff22;font-size:13px;
}
.cg-privacy-row > span { align-self:start;padding-top:11px; }
.cg-privacy-select summary {
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  min-height:40px;padding:6px 8px;list-style:none;cursor:pointer;
  border:1px solid #657797;border-radius:11px;background:#23334d;color:#f2f6ff;
}
.cg-privacy-select summary::-webkit-details-marker { display:none; }
.cg-privacy-select[open] summary,.cg-privacy-choices {
  border:1px solid transparent;
  background:linear-gradient(#16243b,#16243b) padding-box,linear-gradient(125deg,#47eaff,#e046dc) border-box;
}
.cg-privacy-select[open] summary i { rotate:180deg; }
.cg-privacy-choices { margin-top:4px;padding:3px;border-radius:12px; }
.cg-privacy-choices .cg-aero-choice { margin:0;border:0;padding:6px;min-height:42px;font-size:12px; }
.cg-privacy-choices .cg-aero-indicator { display:none; }
.cg-privacy-choices [aria-pressed=true] .cg-aero-indicator { display:grid; }
.cg-privacy-switch { position:absolute;z-index:1;inset:0;width:100%;height:100%;opacity:0;cursor:pointer; }
.cg-privacy-track { position:absolute;inset:0;border-radius:24px;background:#4d5e78; }
.cg-privacy-switch:checked + .cg-privacy-track { background:#0c91cc; }
.cg-privacy-track::after {
  content:"";position:absolute;inset:3px auto 3px 3px;width:18px;border-radius:50%;background:white;
}
.cg-privacy-switch:checked + .cg-privacy-track::after { transform:translateX(20px); }
.cg-privacy-switch:focus-visible + .cg-privacy-track { outline:2px solid #8cedff;outline-offset:2px; }

.cg-policy-dialog {
  padding:0;margin:auto;width:min(720px,calc(100% - 20px));max-width:none;max-height:90dvh;
  color:#eff4ff;background:#0b0615;border:1px solid #637398;border-radius:17px;overflow:hidden;
}
.cg-policy-dialog[open] { display:flex;flex-direction:column; }
.cg-policy-dialog::backdrop { background:#040611d9; }
.cg-policy-dialog > header {
  display:flex;align-items:center;gap:9px;padding:8px 12px;
  background:#17243b;border-bottom:1px solid #546587;
}
.cg-policy-dialog > header h2 { font-size:16px;margin:0; }
.cg-policy-dialog button {
  min-width:44px;min-height:44px;padding:4px 9px;border-radius:10px;background:#253a59;
  color:#f1f6ff;font-size:15px;cursor:pointer;
}
.cg-policy-document { overflow:auto;overscroll-behavior:contain; }

#cgApp .cg-story-ring {
  border:2px solid transparent;
  background:linear-gradient(#16253f,#16253f) padding-box,linear-gradient(135deg,#26e8ff 4%,#8595ff 46%,#f52bda 94%) border-box;
}
#cgApp .cg-story-ring > :is(.cg-av,img) { border-radius:10px; }
#cgApp .cg-story-unseen { box-shadow:0 0 9px #51daf955; }
.cg-contacts-header { padding:10px 12px 4px;max-width:680px; }
.cg-contacts-tools { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:stretch; }
.cg-contacts-search,.cg-contacts-invite {
  display:flex;align-items:center;gap:8px;min-height:42px;padding:6px 10px;
  border:1px solid #506887;border-radius:12px;color:#f0f7ff;background:#18253f;
}
.cg-contacts-search i,.cg-contacts-invite i { color:#7ae8ff; }
.cg-contacts-search input {
  width:100%;min-width:0;padding:0;border:0;color:inherit;background:transparent;font:inherit;font-size:14px;
}
.cg-contacts-search:focus-within { outline:2px solid #8ae8ff;outline-offset:1px; }
.cg-contacts-search input:focus { outline:none; }
.cg-contacts-invite { cursor:pointer;white-space:nowrap;border-color:#9586cd; }
.cg-contacts-search-hint { padding:6px 2px;color:#c6d7ee;font-size:12px; }
#cgApp[data-active-tab=contactos] #cgContactList { max-width:680px;padding-inline:12px; }
#cgContactList .cg-contact-item { margin-block:5px;border-radius:12px;background:#17243c; }

/* ChatG Pro y el estilo de conversaciones del feed */
#cgApp > #cgHeader,
#cgApp > #cgNav,
#cgApp #cgThreadList > .cg-thread,
#cgApp .cg-chat-search-wrap {
  border:1px solid transparent;
  background:var(--chatg-glass) padding-box,var(--chatg-edge) border-box;
}
#cgApp > #cgHeader { min-height:59px;padding-inline:12px; }
#cgApp > #cgHeader .cg-header-title { font-size:19px;color:#f5f8ff;background:none;-webkit-text-fill-color:currentColor; }
#cgApp .cg-chat-search-wrap { margin:0 12px 6px;border-radius:14px; }
#cgApp .cg-chat-search-input::placeholder { color:#cad6ee; }
#cgApp .cg-chat-search-wrap:focus-within { outline:2px solid #9de8ff;outline-offset:1px; }
#cgApp .cg-stories-row { gap:10px;padding-inline:12px; }
#cgApp .cg-story-ring { width:clamp(84px,25vw,114px);height:clamp(102px,28vw,126px); }
#cgApp .cg-story-name { font-size:12px; }
#cgApp #cgThreadList { padding:5px 12px; }
#cgApp #cgThreadList > .cg-thread {
  gap:9px;
  min-height:63px;
  margin-bottom:7px;
  padding:7px 11px;
  border-radius:15px;
}
#cgApp #cgThreadList > .cg-thread:is(:hover,.active) {
  box-shadow:inset 0 0 18px #6b9cff5c;
}
#cgApp .cg-thread-chevron { flex:none;color:#e0ecff;font-size:11px; }
#cgApp .cg-thread--restricted .cg-thread-meta { display:none; }
#cgApp .cg-thread--restricted .cg-thread-chevron { margin-left:auto; }
#cgApp .cg-restricted-view :is(.cg-stories-title,.cg-stories-row,.cg-chat-search-wrap,#cgFilterChips,#cgArchivedSection) { display:none; }
#cgApp .cg-restricted-view:not(.cg-restricted-unlocked) #cgThreadList { visibility:hidden; }
#cgApp .cg-restricted-view #cgThreadList > .cg-thread { min-height:71px; }
#cgApp > #cgNav .cg-nav-item--css .cg-pro-nav-icon { color:#54e7fb; }
#cgStoryQueueOv {
  --story-editor-top:calc(64px + env(safe-area-inset-top,0px));
  --story-editor-bottom:calc(72px + env(safe-area-inset-bottom,0px));
}
#cgStoryQueueOv .cg-studio-canvas-wrap {
  position:absolute;
  inset:var(--story-editor-top) 0 var(--story-editor-bottom);
  width:auto;
  height:auto;
}
#cgStoryQueueOv:has(.story-trim:not([hidden])) .cg-studio-canvas-wrap {
  bottom:calc(var(--story-editor-bottom) + 105px);
}
#cgStoryTrim {
  position:absolute;
  inset:auto 0 calc(var(--story-editor-bottom) + 4px);
  width:min(100%,620px);
  margin:auto;
  border:1px solid #455d80;
  border-radius:12px;
  z-index:5;
}
.cg-story-status:not(:empty) {
  position:absolute;
  z-index:6;
  right:12px;
  bottom:var(--story-editor-bottom);
  max-width:calc(100% - 24px);
  padding:5px 9px;
  border-radius:9px;
  background:#172642;
  color:#fff;
  font-size:12px;
}
#cgStoryQueueOv:has(.story-trim:not([hidden])) .cg-story-status { bottom:calc(var(--story-editor-bottom) + 100px); }
#cgStoryQueueOv .cg-sq-header { gap:6px;padding-inline:10px; }
#cgStoryQueueOv .cg-sq-btn { padding-inline:11px; }
#cgStoryQueueOv .cg-sq-toolbar { gap:clamp(8px,4vw,22px); }
@media (max-width:767px) {
  #cgApp:has(.cg-restricted-view) > :is(#cgHeader,#cgNav) { display:none; }
  #cgApp .cg-restricted-view { padding-bottom:env(safe-area-inset-bottom); }
}

#cgStoryQueueOv .cg-video-preview-control {
    position:absolute;
    inset:auto 0 calc(var(--story-editor-bottom) + 106px);
    z-index:5;
}
#cgStoryQueueOv:has(.cg-video-preview-control:not(:empty)) .cg-studio-canvas-wrap {
    bottom:calc(var(--story-editor-bottom) + 154px);
}
#cgStoryQueueOv:has(.cg-video-preview-control:not(:empty)) .cg-story-status {
    bottom:calc(var(--story-editor-bottom) + 154px);
}
.cg-story-viewer-header {
    position:absolute;
    inset:calc(20px + env(safe-area-inset-top,0px)) 0 auto;
    z-index:12;
    display:flex;
    align-items:center;
    gap:10px;
    padding:4px max(12px,env(safe-area-inset-right,0px)) 4px max(12px,env(safe-area-inset-left,0px));
}
#cgStoryClose {
    flex:none;
    width:44px;
    height:44px;
    margin-inline-start:auto;
    padding:0;
    border:0;
    border-radius:12px;
    background:#17243c;
    color:#fff;
    font-size:21px;
    cursor:pointer;
    touch-action:manipulation;
}
.cg-story-viewer-progress { margin-top:env(safe-area-inset-top,0px); }

:root {
  --cg-feed-button:linear-gradient(155deg,#263859,#222443);
  --cg-feed-button-active:linear-gradient(130deg,#11597e,#244c90 60%,#4b2e83);
  --cg-feed-button-edge:#526694;
  --cg-feed-button-icon:#a2dbf9;
  --cg-feed-button-halo:inset 0 1px #cefbff56,0 0 9px #58d9ff45;
  --cg-design-panel:linear-gradient(150deg,#132540,#0b172c 58%,#091426);
}
.cg-filter-bar { display:flex;align-items:center;gap:3px;min-width:0;padding-inline:8px; }
#cgApp .cg-restricted-view .cg-filter-bar { display:none; }
#cgApp > #cgMain .cg-filter-chips {
  min-width:0;flex:1;flex-wrap:nowrap;padding:6px 3px 8px;
  overscroll-behavior-inline:contain;
}
#cgApp > #cgMain .cg-chip,
.cg-nc-actions button,
.cg-chat-bg-sheet [data-pattern] {
  display:inline-flex;align-items:center;gap:6px;min-height:38px;
  padding:7px 11px;border:1px solid var(--cg-feed-button-edge);
  border-radius:11px;color:#e0eaff;background:var(--cg-feed-button);
  font-size:12px;font-weight:650;white-space:nowrap;cursor:pointer;
}
#cgApp > #cgMain .cg-chip i,.cg-nc-actions button i { color:var(--cg-feed-button-icon); }
#cgApp > #cgMain .cg-chip:hover,.cg-nc-actions button:hover,.cg-chat-bg-sheet [data-pattern]:hover {
  border-color:#a99be8;color:#fff;
}
#cgApp > #cgMain .cg-chip.active,.cg-chat-bg-sheet [data-pattern][aria-pressed=true] {
  color:#fff;border-color:#86e9ff;background:var(--cg-feed-button-active);
  box-shadow:var(--cg-feed-button-halo);
}
.cg-filter-arrow {
  flex:0 0 26px;min-height:38px;border-radius:9px;
  color:#c6e9ff;background:#1c2b49;cursor:pointer;
}
.cg-filter-arrow:disabled { opacity:.35;cursor:default; }

#cgConvPanel .cg-conv-header {
  min-height:60px;gap:8px;padding:8px 10px;
  padding-top:calc(8px + env(safe-area-inset-top,0px));
  color:#f3f7ff;background:linear-gradient(140deg,#132640,#0d1b32 65%,#132741);
  border-bottom:1px solid #416591;backdrop-filter:none;
}
#cgConvPanel .cg-conv-back,#cgConvPanel .cg-conv-actions .cg-icon-btn,.cg-design-square {
  display:grid;place-items:center;flex:none;
  width:44px;height:44px;padding:0;line-height:1;
  border:1px solid #5794bf;border-radius:11px;color:#b5eeff;
  background:linear-gradient(150deg,#17385a,#112543);font-size:17px;cursor:pointer;
  touch-action:manipulation;
}
#cgConvPanel :is(.cg-conv-back,.cg-conv-actions .cg-icon-btn):hover,.cg-design-square:hover {
  border-color:#86e9ff;color:#f3fcff;background:#214773;
}
#cgConvPanel .cg-conv-info { min-width:0;gap:8px;cursor:inherit; }
#cgConvPanel .cg-conv-info .cg-profile-photo,#cgConvPanel .cg-conv-info > .cg-av { flex:none;border-radius:12px; }
#cgConvPanel .cg-conv-actions { flex:none;gap:5px; }
.cg-conv-identity,.cg-group-identity { flex:1;min-width:0;text-align:start; }
.cg-conv-identity { display:block;color:inherit;background:transparent;font:inherit;cursor:pointer; }
#cgConvPanel .cg-conv-name {
  display:block;color:#f3f7ff;font-size:15px;line-height:1.25;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
#cgConvPanel .cg-conv-status { display:flex;align-items:center;gap:5px;color:#c0d4ec;font-size:11px;line-height:1.4; }
.cg-conv-status--online::before {
  content:"";width:7px;height:7px;flex:none;border-radius:50%;background:#36e2a1;
}
.cg-conv-security {
  display:flex;justify-content:center;align-items:center;gap:7px;flex:none;
  width:100%;min-height:34px;padding:6px 10px;border-bottom:1px solid #38567e;
  color:#dceafe;background:#112139;font:inherit;font-size:11px;cursor:pointer;
}
.cg-conv-security:hover { background:#1b3454; }
@media (min-width:768px) {
  #cgConvPanel .cg-conv-header { gap:12px;padding:10px 13px; }
  #cgConvPanel .cg-conv-name { font-size:17px; }
  #cgConvPanel .cg-conv-actions { gap:8px; }
}
@media (max-width:360px) {
  #cgConvPanel .cg-conv-header { gap:5px;padding-inline:6px; }
  #cgConvPanel .cg-conv-info,#cgConvPanel .cg-conv-actions { gap:4px; }
  #cgConvPanel .cg-conv-info .cg-profile-photo { width:34px!important;height:34px!important; }
  #cgConvPanel .cg-conv-name { font-size:14px; }
}

#cgNewChatSheet {
  position:fixed;inset:0;margin:auto;padding:0;overflow:hidden;
  width:min(94vw,500px);max-width:none;max-height:min(88dvh,780px);
  border:1px solid #517aac;border-radius:20px;
  color:#f2f7ff;background:var(--cg-design-panel);
  font-family:var(--cg-font);box-shadow:0 16px 55px #0009;
}
#cgNewChatSheet[open] { display:flex;flex-direction:column; }
#cgNewChatSheet::backdrop { background:#060a16c9;backdrop-filter:blur(5px); }
.cg-design-sheet-heading {
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  flex:none;padding:10px 16px;border-bottom:1px solid #3c5c86;
}
.cg-design-sheet-heading h2 { margin:0;color:#f1f6ff;font-size:20px;line-height:1.2; }
.cg-nc-tools { padding:12px 16px; }
.cg-nc-actions { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:12px; }
.cg-nc-actions button {
  min-height:56px;white-space:normal;text-align:start;line-height:1.25;
  font-family:inherit;font-size:14px;
}
.cg-nc-actions button i { flex:none;font-size:17px; }
.cg-nc-list { min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 16px 12px; }
.cg-nc-list > h3 { margin:2px 0 5px;color:#a9c3e5;font-size:13px; }
.cg-nc-empty { padding:14px 0;color:#acc3e0;font-size:14px; }
.cg-contact-picker-row {
  display:flex;align-items:center;gap:11px;width:100%;min-height:59px;
  padding:7px 6px;border:0;border-bottom:1px solid #375178;border-radius:0;
  background:transparent;color:#f4f8ff;font:inherit;text-align:start;cursor:pointer;
}
.cg-contact-picker-row:hover { background:#1a2d4a; }
.cg-contact-picker-row > .cg-thread-av { position:relative;flex:none; }
.cg-contact-picker-row .cg-thread-av .cg-av { width:44px;height:44px;border-radius:12px; }
.cg-contact-picker-name { display:grid;gap:3px;flex:1;min-width:0; }
.cg-contact-picker-name > * { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.cg-contact-picker-name strong { font-size:15px; }
.cg-contact-picker-name small { color:#b5c9e6;font-size:12px; }
.cg-contact-picker-row > i { color:#b7ddff;font-size:12px; }
.cg-contacts-header { padding:12px 12px 8px; }
.cg-contacts-secondary { display:flex;justify-content:space-between;gap:8px;margin-top:8px; }
.cg-contacts-secondary button {
  min-height:36px;padding:4px 9px;border:1px solid #3c587d;border-radius:10px;
  color:#cfe3ff;background:#13243e;font:inherit;font-size:12px;cursor:pointer;
}
.cg-contacts-secondary button[aria-pressed=true] { background:#173e68;border-color:#86e9ff; }
.cg-contacts-online i { color:#36e2a1;font-size:8px; }
@media (max-width:540px) {
  #cgNewChatSheet { inset:auto 0 0;margin:0;width:100%;max-height:90dvh;border-radius:20px 20px 0 0;padding-bottom:env(safe-area-inset-bottom,0px); }
}

.cg-chat-bg-sheet > .cg-chat-bg-panel {
  width:min(100%,520px);max-height:88dvh;
  padding:0 15px calc(14px + env(safe-area-inset-bottom,0px));
  border-radius:20px 20px 0 0;background:var(--cg-design-panel)!important;
}
.cg-chat-bg-panel .cg-design-sheet-heading { padding-inline:0;margin-bottom:10px; }
.cg-chat-bg-panel .cg-design-sheet-heading i { color:#a2dbf9; }
.cg-chat-bg-panel .cg-bg-preview { min-height:130px;border:1px solid #416089; }
.cg-chat-bg-sheet [data-pattern] { justify-content:center;min-height:40px; }
.cg-chat-bg-panel .cg-bg-swipe-row {
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;
  overflow:visible;scroll-snap-type:none;padding:3px;margin:0 0 10px;
}
.cg-chat-bg-panel .cg-bg-swatch-wrap { width:100%;min-width:0;background:none;color:#e2ebfa;cursor:pointer; }
.cg-chat-bg-panel .cg-bg-swatch {
  display:grid;place-items:center;width:100%;height:auto;aspect-ratio:1.55;max-height:79px;
  color:#a8dfff;background-color:#1b2f4a;border:1px solid #55739b;border-radius:11px;
}
.cg-chat-bg-panel .cg-bg-swatch-wrap[aria-pressed=true] .cg-bg-swatch {
  border-color:#86e9ff;box-shadow:0 0 0 1px #86e9ff,0 0 9px #58d9ff45;
}
.cg-chat-bg-panel .cg-bg-swatch-label {
  max-width:none;white-space:normal;text-overflow:clip;color:#dce8fb;font-size:11px;line-height:1.2;
  overflow-wrap:anywhere;
}
#cgNewChatSheet :is(button,input):focus-visible,.cg-chat-bg-sheet button:focus-visible,
.cg-contact-picker-row:focus-visible { outline:2px solid #9de8ff;outline-offset:-2px; }

/* Portadas de historias */
.cg-story-art {
  position:absolute;
  inset:0;
  overflow:hidden;
  border-radius:inherit;
  background:linear-gradient(145deg,#1a3454,#1e2449);
  color:#dcf3ff;
}
.cg-story-art :is(img,video) {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  pointer-events:none;
}
.cg-story-art-fallback {
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  padding:9px 7px 25px;
  overflow:hidden;
  text-align:center;
  overflow-wrap:anywhere;
  font-size:12px;
  font-weight:700;
}
.cg-story-video-badge {
  position:absolute;
  inset:8px 7px auto auto;
  display:grid;
  place-items:center;
  width:23px;
  height:23px;
  border:1px solid #a2d7ff;
  border-radius:50%;
  background:#08182bd9;
  color:#fff;
  font-size:9px;
}

/* Barra de mensajes y adjuntos */
#cgConvPanel .cg-input-area {
  padding:8px 10px calc(8px + env(safe-area-inset-bottom,0px));
  border-top:1px solid #344e77;
  background:#0e1b31;
}
#cgConvPanel:has(> .cg-recorder) > .cg-input-area { display:none; }
#cgConvPanel .cg-input-row { gap:7px; }
#cgConvPanel .cg-send-btn {
  width:46px;
  height:46px;
  color:#f8fcff;
  border:1px solid #67bdff;
  background:linear-gradient(140deg,#1686c4,#164d90);
  font-size:18px;
}
#cgConvPanel .cg-send-btn:disabled { opacity:.65; }
#cgConvPanel :is(.cg-input-btn,.cg-send-btn):focus-visible { outline:2px solid #a4eaff;outline-offset:-2px; }
@media (max-width:360px) {
  #cgConvPanel .cg-input-area { padding-inline:6px; }
  .cg-composer-field { gap:0;padding-inline:2px; }
  .cg-input-btn { width:36px; }
}
#cgAttachSheet {
  position:fixed;
  inset:auto 0 0;
  margin:0 auto;
  width:min(100%,500px);
  max-width:none;
  max-height:85dvh;
  overflow:auto;
  padding:8px 14px calc(14px + env(safe-area-inset-bottom,0px));
  color:#eef6ff;
  background:linear-gradient(150deg,#142744,#0b172d);
  border:1px solid #42628e;
  border-radius:22px 22px 0 0;
  font-family:var(--cg-font);
}
#cgAttachSheet::backdrop { background:#051022ac;backdrop-filter:blur(3px); }
.cg-attach-header { text-align:center;padding-bottom:10px; }
.cg-attach-header .cg-modal-handle { display:block;margin:2px auto 8px;background:#6089b8; }
.cg-attach-header h2 { margin:0;font-size:19px; }
.cg-attach-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px 5px;margin:0 0 14px; }
.cg-attach-item {
  display:flex;
  min-width:0;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:2px 0;
  border-radius:10px;
  color:#e4efff;
  font:inherit;
  font-size:12px;
  line-height:1.25;
  text-align:center;
  cursor:pointer;
}
.cg-attach-icon {
  display:grid;
  place-items:center;
  width:48px;
  height:48px;
  border:1px solid color-mix(in srgb,var(--attach-color) 55%,#506888);
  border-radius:13px;
  background:color-mix(in srgb,var(--attach-color) 14%,#101d32);
  color:color-mix(in srgb,var(--attach-color) 78%,#e9f5ff);
  font-size:19px;
}
.cg-attach-item:hover .cg-attach-icon { background:color-mix(in srgb,var(--attach-color) 24%,#101d32); }
.cg-attach-close {
  display:block;
  width:100%;
  min-height:43px;
  border:1px solid #486991;
  border-radius:13px;
  color:#eff7ff;
  background:#172c49;
  font:inherit;
  font-weight:650;
  cursor:pointer;
}
#cgAttachSheet button:focus-visible { outline:2px solid #a2eaff;outline-offset:-1px; }

/* Notas de voz */
#cgConvPanel .cg-bubble--voice { width:min(78%,320px);min-width:0;padding:8px 10px 5px; }
#cgConvPanel .cg-bubble-wrap.me .cg-bubble--voice {
  background:var(--cg-bubble-bg,linear-gradient(145deg,#165783,#123c63));
  border:1px solid #52a3d5;
}
#cgConvPanel .cg-bubble-wrap.them .cg-bubble--voice {
  background:#142944;
  border:1px solid #45688e;
}
#cgConvPanel .cg-voice-bubble {
  display:flex;
  align-items:flex-start;
  gap:8px;
  min-width:0;
}
#cgConvPanel .cg-voice-play,#cgVCenterBtn {
  flex:none;
  width:39px;
  height:39px;
  display:grid;
  place-items:center;
  border:1px solid #6ac5f4;
  border-radius:50%;
  background:linear-gradient(145deg,#248dc1,#185186);
  color:#f7fbff;
  font-size:14px;
  cursor:pointer;
}
.cg-voice-track { min-width:0;flex:1; }
#cgConvPanel .cg-voice-wave-wrap {
  position:relative;
  min-width:0;
  width:auto;
  height:33px;
  margin:0;
}
.cg-voice-bars {
  display:flex;
  align-items:center;
  gap:2px;
  height:100%;
  width:100%;
}
.cg-voice-bars > span {
  height:var(--voice-peak);
  min-height:2px;
  flex:1;
  border-radius:4px;
  background:#6f9cc8;
}
.cg-voice-bars > .cg-voice-bar--played { background:#48e3ff;box-shadow:0 0 4px #38b7e866; }
.cg-voice-seek {
  position:absolute;
  width:100%;
  height:100%;
  inset:0;
  margin:0;
  opacity:0;
  cursor:pointer;
}
.cg-voice-wave-wrap:focus-within { outline:2px solid #a3eaff;border-radius:5px; }
.cg-voice-caption { display:flex;align-items:center;flex-wrap:wrap;gap:4px 7px;margin-top:3px; }
#cgConvPanel .cg-voice-dur {
  color:#e4f2ff;
  font-size:11px;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.cg-voice-delivery { color:#dce9fa;font-size:11px; }
.cg-voice-delivery--failed { color:#ffd5d6; }
.cg-voice-retry,.cg-voice-drop {
  min-height:29px;
  padding:3px 6px;
  border:1px solid #83ade0;
  border-radius:7px;
  color:#f3f8ff;
  background:#24456f;
  font:inherit;
  font-size:11px;
  cursor:pointer;
}

/* Grabación con preescucha */
.cg-recorder {
  flex:none;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));
  border-top:1px solid #47739f;
  background:linear-gradient(155deg,#172b49,#0c1b31);
  color:#eef6ff;
}
.cg-recorder-heading,.cg-recorder-heading > div,.cg-recorder-player-caption {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:7px;
}
.cg-recorder-heading { padding:0 3px 7px; }
.cg-recorder-heading i { color:#9fdefb; }
.cg-recorder-clock { font-variant-numeric:tabular-nums;font-weight:650; }
#cgVStateDot { width:7px;height:7px;border-radius:50%;background:#54d9ff;animation:cgPulse .9s ease-in-out infinite; }
.cg-recorder-player {
  display:flex;
  align-items:center;
  gap:8px;
  padding:7px 8px;
  border:1px solid #3c5e8a;
  border-radius:15px;
  background:#0f223c;
}
#cgVCenterBtn { width:44px;height:44px; }
.cg-recorder-track { min-width:0;flex:1; }
#cgVWaveWrap { position:relative; }
#cgVCanvas { display:block;width:100%;height:39px;touch-action:none; }
#cgVTooltip {
  position:absolute;
  top:0;
  display:none;
  padding:2px 5px;
  border-radius:4px;
  color:#d5f0ff;
  background:#07172a;
  font-size:11px;
  pointer-events:none;
}
.cg-recorder-player-caption { color:#c4d9f4;font-size:11px; }
#cgVPreviewRow { align-items:center;gap:8px; }
#cgVPlayBar { flex:1;min-width:0;accent-color:#49d9ff; }
#cgVPlayTs { color:#d7eaff;font-size:11px;font-variant-numeric:tabular-nums; }
.cg-recorder-actions { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:8px; }
.cg-recorder-actions button {
  display:flex;
  justify-content:center;
  align-items:center;
  gap:5px;
  min-width:0;
  min-height:44px;
  padding:4px 2px;
  border:1px solid #4c7099;
  border-radius:12px;
  color:#e2eeff;
  background:#192f4e;
  font:inherit;
  font-size:12px;
  cursor:pointer;
}
#cgVDiscardBtn { color:#ffb8ba; }
#cgVSendBtn { background:linear-gradient(145deg,#187dab,#1a508c);border-color:#73d8fb;color:#fff;font-weight:700; }
.cg-recorder button:focus-visible,.cg-voice-bubble button:focus-visible { outline:2px solid #adeeff;outline-offset:-2px; }
#cgConvPanel .cg-voice-bubble--listened .cg-voice-dur { color:#9df0cb; }

#cgHeaderTheme {
  background:#233d60; color:#adf0ff; border:1px solid #789fca;
  box-shadow:inset 0 1px 1px #ebf8ff33;
}
#cgHeaderTheme:hover,#cgHeaderTheme:focus-visible { background:#34537a; color:#e5fbff; }

.cg-history-recovery {
  width:min(92vw,460px); max-height:85dvh; overflow:auto; padding:22px;
  color:#eff7ff; background:linear-gradient(150deg,#182840,#101a2e 55%,#151b32);
  border:1px solid #4d648a; border-radius:20px; font:inherit; color-scheme:dark;
}
.cg-history-recovery::backdrop { background:#050e20bd; backdrop-filter:blur(5px); }
.cg-history-recovery h2 { font-size:19px; margin:0 0 8px; }
.cg-history-recovery p { color:#c0cfe6; }
.cg-recovery-options { display:grid; gap:8px; margin:14px 0; }
.cg-recovery-options img { max-width:100%; margin:auto; border-radius:9px; }
.cg-recovery-options a { color:#98edff; }
.cg-history-recovery :is(button,input) {
  box-sizing:border-box; width:100%; min-height:42px;
  padding:8px 12px; border:1px solid #6683ab; border-radius:10px;
  background:#1b2c49; color:inherit; font:inherit;
}
.cg-history-recovery label input { margin-top:8px; }
.cg-history-recovery :focus-visible { outline:2px solid #8cedff; outline-offset:2px; }

.cg-call-filters {
  display:flex; gap:4px; margin:4px 14px 14px; padding:3px;
  background:#182a44; border:1px solid #596f9b; border-radius:999px;
}
.cg-call-filters button {
  flex:1; min-height:39px; border:0; border-radius:999px;
  background:transparent; color:#e4efff; font:inherit; cursor:pointer;
}
.cg-call-filters button[aria-pressed="true"] { background:#63eaff; color:#082333; font-weight:750; }
#cgCallList { padding:0 14px 15px; }
.cg-call-day { margin:15px 3px 8px; font-size:16px; color:var(--cg-text); }
.cg-call-record {
  display:grid; grid-template-columns:44px minmax(0,1fr) auto 42px; align-items:center; gap:10px;
  padding:10px; margin-bottom:7px; border:1px solid transparent; border-radius:15px;
  background:linear-gradient(145deg,#19344a,#101c31) padding-box,linear-gradient(130deg,#49bdce,#7563b9) border-box;
  color:#f0f7ff;
}
.cg-call-avatar {
  display:grid; place-items:center; position:relative; overflow:hidden; width:44px; aspect-ratio:1;
  border-radius:50%; background:#243e61; color:#a9eefe; font-weight:750;
}
.cg-call-avatar img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.cg-call-record .cg-call-info { min-width:0; display:grid; gap:2px; }
.cg-call-record .cg-call-info strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cg-call-record small,.cg-call-duration { color:#c3d6ea; font-size:12px; }
.cg-call-record[data-state="missed"] small,.cg-call-record[data-state="declined"] small { color:#ffa9bb; }
.cg-call-record[data-state="offline"] small,.cg-call-record[data-state="unanswered"] small { color:#ffd17d; }
.cg-call-duration { white-space:nowrap; }
.cg-call-recall { width:42px; aspect-ratio:1; border-radius:50%; border:1px solid #53dff5; color:#8eeeff; background:#102538; cursor:pointer; }
.cg-call-recall:hover { background:#22465f; }
.cg-call-recall:focus-visible,.cg-call-filters button:focus-visible { outline:2px solid #b7f6ff; outline-offset:2px; }
@media(max-width:365px) {
  .cg-call-record { gap:6px; grid-template-columns:34px minmax(0,1fr) auto 39px; padding:8px; }
  .cg-call-avatar { width:34px; }
  .cg-call-recall { width:39px; }
}

.cg-install-shortcut {
  margin:10px auto 0;
  padding:7px 13px;
  border:1px solid #6686a7;
  border-radius:10px;
  background:#152940;
  color:#e2f6ff;
  cursor:pointer;
  font:inherit;
  font-size:13px;
}
.cg-install-shortcut[hidden] { display:none; }
.cg-install-shortcut:focus-visible { outline:2px solid #9deaff; outline-offset:2px; }
