:root {
  --bg: #f2f3ef;
  --bg-2: #eaece6;
  --card: #ffffff;
  --ink: #17191c;
  --muted: #6b7079;
  --line: #e3e5de;
  --accent: #2c5b4f;
  --accent-2: #3a7566;
  --accent-soft: #e5eee9;
  --online: #2e9d6b;
  --danger: #b3261e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 25, 20, 0.05), 0 8px 24px rgba(20, 25, 20, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #e4ece7 0%, transparent 60%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); min-height: 1.2em; margin: 6px 0 0; font-size: 14px; }

/* ----- Botones y campos ----- */
button {
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
button:hover { background: var(--accent-2); border-color: var(--accent-2); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
button.ghost:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; }

label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: auto; accent-color: var(--accent); }

/* ----- Pantallas y tarjetas ----- */
.screen { min-height: 100vh; display: grid; place-items: center; padding: 16px; }

.card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
}
.card h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 700;
  font-size: 30px;
  margin: 0;
  letter-spacing: -0.01em;
}
.card h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 700;
  font-size: 22px;
  margin: 0;
}
.card form { display: grid; gap: 14px; margin-top: 6px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 22, 0.35);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 10;
}

.row { display: flex; gap: 8px; justify-content: flex-end; }

/* ----- +18 y avisos ----- */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 6px;
  padding: 0 6px;
  line-height: 1.5;
}

.notice {
  margin: 4px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.notice .tag { margin-right: 4px; }

/* ----- Avatares ----- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--muted);
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--card);
  position: relative;
}
.avatar .mod-star {
  position: absolute; right: 0; bottom: -2%;
  line-height: 1; color: #ffc93c; font-weight: 400;
  text-shadow: 0 0 2px #000, 0 0 3px rgba(0,0,0,.8);
  pointer-events: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pointer { cursor: pointer; }

.avatar-edit { display: grid; gap: 10px; justify-items: center; }
.avatar-box {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.avatar-box img { width: 100%; height: 100%; object-fit: cover; }
.avatar-box .avatar { width: 104px; height: 104px; }
.avatar-edit input[type="file"] { padding: 6px; font-size: 13px; }

/* ----- Barra superior ----- */
.app { display: flex; flex-direction: column; padding: 0; place-items: stretch; min-height: 0; height: 100vh; height: 100dvh; overflow: hidden; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--accent), #1d4238);
  color: #fff;
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 700;
  font-size: 19px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(44, 91, 79, 0.25);
}
.titles { display: grid; min-width: 0; }
.topbar strong {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 700;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}
.subtitle {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.me {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 600;
  max-width: 220px;
}
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }

/* ----- Layout ----- */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 216px;
  gap: 14px;
  padding: 14px;
  min-height: 0;
}

aside {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  overflow-y: auto;
  min-height: 0;
  box-shadow: var(--shadow);
}
aside h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 8px 6px;
}
aside h3:first-child { margin-top: 4px; }

/* ----- Salas y privados ----- */
.side-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 2px 0;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 10px;
}
.side-btn:hover { background: var(--bg); color: var(--ink); }
.side-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}
.side-btn.unread .name { font-weight: 700; }
.side-btn .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.count {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.count:empty { display: none; }
.count.live::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 0 3px rgba(46, 157, 107, 0.15);
}
.side-btn.active .count { color: var(--accent); }

.nbadge {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(44, 91, 79, 0.3);
}

/* ----- Usuarios conectados ----- */
.users ul { list-style: none; padding: 0; margin: 0; }
.users li.user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 14px;
  word-break: break-word;
}
.users li.clickable { cursor: pointer; }
.users li.clickable:hover { background: var(--bg); }
.users li.user.dim { opacity: 0.45; }
.view-nick { font-family: 'Source Serif 4', Georgia, serif; font-size: 20px; text-align: center; }
.view-bio { margin: 0; text-align: center; color: var(--muted); word-break: break-word; }

/* ----- Pestañas de salas y privados abiertos ----- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 0 4px;
  margin-bottom: -10px; /* las pestañas apoyan sobre la ventana de chat */
  position: relative;
  z-index: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  max-width: 220px;
  padding: 8px 8px 8px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.tab:hover { color: var(--ink); background: #f7f8f5; }
.tab.active {
  color: var(--accent);
  background: var(--card);
  box-shadow: inset 0 2px 0 var(--accent);
}
.tab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tab-close {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 0 4px;
  font-size: 16px;
  line-height: 1;
  font-weight: 400;
  border-radius: 6px;
}
.tab-close:hover { color: var(--danger); background: var(--accent-soft); }
.badge {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* ----- Chat ----- */
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 10px; }

.messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c9cdc4 transparent;
  box-shadow: var(--shadow);
}

.msg { display: flex; align-items: flex-start; gap: 11px; padding: 7px 10px; margin: 0 -6px; border-radius: 12px; }
.msg:hover { background: #f7f8f5; }
.msg .body { flex: 1; min-width: 0; }
.msg .head { display: flex; align-items: baseline; gap: 8px; }
.msg .nick { font-weight: 700; font-size: 14px; }
.msg .nick.pointer:hover { text-decoration: underline; text-underline-offset: 2px; }
.msg .time { color: var(--muted); font-size: 12px; }
.msg .text { margin-top: 2px; line-height: 1.5; word-break: break-word; }
.msg.mine .nick { color: var(--accent); }
.msg .report { opacity: 0; transition: opacity 0.15s; }
.msg:hover .report { opacity: 1; }

.report {
  align-self: center;
  background: transparent;
  color: var(--muted);
  border: none;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 6px;
}
.report:hover { color: var(--danger); background: transparent; }

.empty {
  margin: auto;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* ----- Barra de envío ----- */
.send {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.send #text {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 10px 12px;
  box-shadow: none;
}
.send #text:focus { box-shadow: none; }
.send button[type="submit"] {
  border-radius: 999px;
  padding: 10px 20px;
}

/* ----- Emotes y adjuntos ----- */
.emote-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.emote-btn:hover { background: var(--accent-soft); border-color: var(--accent-soft); }

.emote-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 8px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.emote-pick {
  display: grid;
  place-items: center;
  padding: 8px 4px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid transparent;
}
.emote-pick:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.emote-pick .emote { font-size: 1.5em; }

.emote {
  display: inline-block;
  font-size: 1.35em;
  line-height: 1;
  vertical-align: -0.2em;
  transform-origin: center bottom;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  animation-duration: 1.2s;
}
.emote.bounce  { animation-name: bounce; }
.emote.spin    { animation-name: spin; animation-timing-function: linear; animation-duration: 2.4s; }
.emote.shake   { animation-name: shake; animation-duration: 0.4s; }
.emote.pulse   { animation-name: pulse; }
.emote.float   { animation-name: float; animation-duration: 2s; }
.emote.flicker { animation-name: flicker; animation-duration: 0.9s; }
.emote.wiggle  { animation-name: wiggle; }
.emote.pop     { animation-name: pop; animation-duration: 1.6s; }

@keyframes bounce  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes shake   { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-2px) rotate(-6deg); } 75% { transform: translateX(2px) rotate(6deg); } }
@keyframes pulse   { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes float   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px) rotate(4deg); } }
@keyframes flicker { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08) rotate(-3deg); opacity: 0.85; } }
@keyframes wiggle  { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes pop     { 0%, 60%, 100% { transform: scale(1); } 70% { transform: scale(1.35); } 80% { transform: scale(0.9); } }

@media (prefers-reduced-motion: reduce) {
  .emote { animation: none !important; }
}

/* ----- Fotos y videos en privados ----- */
.media-link { display: block; width: fit-content; max-width: 100%; margin-top: 4px; }
.media-img {
  display: block;
  max-width: 280px;
  max-height: 260px;
  border-radius: 12px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}
.media-video {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-top: 4px;
  border-radius: 12px;
  background: #000;
}

/* ----- Menú de usuario ----- */
.user-menu {
  position: fixed;
  z-index: 70;
  width: 250px;
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(20, 25, 20, 0.16);
}
.um-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.um-head strong {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.um-bio { margin: 0; font-size: 13px; color: var(--muted); word-break: break-word; }
.um-btn {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  text-align: left;
  font-weight: 600;
  padding: 8px 12px;
}
.um-btn:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.um-btn.um-danger { color: var(--danger); }
.um-btn.um-danger:hover { background: #fbeceb; border-color: #fbeceb; color: var(--danger); }

/* ----- Móvil ----- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 210px minmax(0, 1fr) 170px; }
}
@media (max-width: 800px) {
  .card h1 { font-size: 26px; }
  .me > span:not(.avatar) { display: none; }
  .me { padding: 3px; }
  .subtitle { display: none; }
}

/* ----- Ingreso con cuenta ----- */
.auth { gap: 14px; }
.auth-logo { margin: 0 0 2px; }
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.seg-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 8px;
  font-weight: 600;
}
.seg-btn:hover { background: transparent; color: var(--ink); }
.seg-btn.active { background: var(--card); color: var(--accent); box-shadow: 0 1px 3px rgba(20, 25, 20, 0.1); }
.auth-form { margin-top: 0; }
.guest-box { display: grid; gap: 8px; }
.guest-box .small { margin: 0; text-align: center; }
.ok { color: var(--accent); margin: 6px 0 0; font-size: 14px; }
.row.between { justify-content: space-between; align-items: center; }

/* ----- Roles, moderación y panel ----- */
.top-right { display: flex; align-items: center; gap: 8px; }
.panel-link {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  border-radius: 999px;
}
.panel-link:hover { background: var(--accent); color: #fff; }

.tilde { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; margin-left:4px; border-radius:50%; background:#1d9bf0; color:#fff; font-size:10px; font-weight:900; line-height:1; vertical-align:middle; flex:none; }
.role-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  line-height: 1.5;
  align-self: center;
}
.role-tag.admin { background: #7a3e9d; }
.role-tag.mod { background: #b26a00; }
.users li.user .role-tag { margin-left: auto; }

.mod-del {
  align-self: center;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
}
.mod-del:hover { background: var(--danger); color: #fff; }

/* Panel de administración */
.panel-wrap { max-width: 980px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }
.panel-wrap h1 { font-family: 'Source Serif 4', Georgia, serif; margin: 0; font-size: 26px; }
.panel-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.panel-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.panel-tabs button.ghost.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.item { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; }
.item .meta { font-size: 13px; color: var(--muted); }
.item .quote { background: var(--bg); border-radius: 10px; padding: 8px 10px; word-break: break-word; }
.item .actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.item .actions select, .item .actions input { width: auto; padding: 6px 8px; }
.item .actions button { padding: 6px 10px; font-size: 13px; }
.item .actions button.danger { background: var(--danger); border-color: var(--danger); }
.item .actions button.danger:hover { background: #8f1d17; border-color: #8f1d17; }
.empty-note { color: var(--muted); font-size: 14px; margin: 10px 0 0; }

/* ----- Fotos y videos: botón en el chat y ventana para verlos ----- */
.media-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  background: var(--bg);
  color: var(--accent);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 14px;
  padding: 7px 12px;
  border-radius: 999px;
}
.media-chip:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.media-modal { z-index: 30; }
.media-box {
  position: relative;
  max-width: min(92vw, 900px);
  max-height: 90vh;
  display: grid;
  gap: 10px;
  justify-items: end;
}
.media-x { padding: 6px 12px; font-size: 13px; }
.media-full {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  background: #000;
  object-fit: contain;
}

/* ===== Social Nebu: solo la cabecera y la barra de envío van en el estilo nuevo ===== */
:root {
  --s-paper: #f7f4ec;
  --s-ink: #17173a;
  --s-pink: #ff3d8b;
  --s-pink-2: #e02a75;
  --s-blue: #2238c9;
  --s-dot: rgba(34, 56, 201, 0.13);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --s-paper: #15132c; --s-ink: #f7f4ec; --s-pink: #ff5c9d; --s-pink-2: #ff7fb2; --s-blue: #8c9bff; --s-dot: rgba(140, 155, 255, 0.15);
  }
}
:root[data-theme="dark"] {
  --s-paper: #15132c; --s-ink: #f7f4ec; --s-pink: #ff5c9d; --s-pink-2: #ff7fb2; --s-blue: #8c9bff; --s-dot: rgba(140, 155, 255, 0.15);
}

.topbar {
  background: var(--s-paper) radial-gradient(var(--s-dot) 1.2px, transparent 1.4px) 0 0 / 14px 14px;
  border-bottom: 2px solid var(--s-ink);
  box-shadow: 0 4px 0 var(--s-pink);
}
.topbar .logo {
  background: var(--s-pink);
  color: #fff;
  border: 2px solid var(--s-ink);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--s-ink);
  font-family: 'Anton', Impact, sans-serif;
  font-weight: 400;
  font-size: 22px;
}
.topbar strong {
  font-family: 'Anton', Impact, sans-serif;
  font-weight: 400;
  font-size: 26px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--s-ink);
}
.topbar .subtitle { font-family: 'Archivo', system-ui, sans-serif; }
.topbar .me {
  background: #ffffff;
  border: 2px solid var(--s-ink);
  box-shadow: 3px 3px 0 var(--s-ink);
  color: #17173a;
}
.topbar .me:hover { background: #ff3d8b; color: #ffffff; }
.topbar .panel-link {
  background: var(--s-paper);
  color: var(--s-ink);
  border: 2px solid var(--s-ink);
  box-shadow: 2px 2px 0 var(--s-ink);
}
.topbar .panel-link:hover { background: var(--s-pink); color: #fff; }

/* ===== Social Nebu: pantalla de ingreso en el estilo nuevo ===== */
#register .card {
  background: #ffffff radial-gradient(rgba(34, 56, 201, 0.12) 1.2px, transparent 1.4px) 0 0 / 14px 14px;
  border: 2px solid #17173a;
  border-top: 10px solid #ff3d8b;
  border-radius: 12px;
  box-shadow: 8px 8px 0 #2238c9;
  padding: 34px;
}
#register .card h1 {
  font-family: 'Anton', Impact, sans-serif;
  font-weight: 400;
  font-size: 56px;
  line-height: 0.95;
  text-transform: uppercase;
  color: #17173a;
}
#register .card h1::after { content: "."; color: #ff3d8b; }
#register .seg { background: #f7f4ec; border: 2px solid #17173a; }
#register .seg-btn { font-family: 'Anton', Impact, sans-serif; font-weight: 400; text-transform: uppercase; font-size: 16px; letter-spacing: 0.03em; }
#register .seg-btn.active { background: #2238c9; color: #ffffff; border-color: #17173a; box-shadow: 3px 3px 0 #17173a; }
#register .seg-btn.active { color: #ffffff; }
#register .card button[type="submit"] { font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: 20px; padding: 12px 16px; }
#register .guest-box button.ghost { background: #2238c9; color: #ffffff; border-color: #17173a; font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: 18px; text-transform: uppercase; }
#register .guest-box button.ghost:hover { background: #1a2aa0; color: #ffffff; }
#register .notice .tag { background: #ff3d8b; color: #fff; }

/* ===== Social Nebu: cabecera del panel de admin en el estilo nuevo ===== */
.panel-wrap > header {
  background: #f7f4ec radial-gradient(rgba(34, 56, 201, 0.13) 1.2px, transparent 1.4px) 0 0 / 14px 14px;
  border: 2px solid #17173a;
  border-top: 8px solid #ff3d8b;
  border-radius: 12px;
  box-shadow: 6px 6px 0 #2238c9;
  padding: 16px 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-wrap > header h1 {
  font-family: 'Anton', Impact, sans-serif;
  font-weight: 400;
  font-size: 40px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #17173a;
}
.panel-wrap > header h1::after { content: "."; color: #ff3d8b; }
.panel-wrap > header .panel-link {
  background: #ff3d8b;
  color: #ffffff;
  border: 2px solid #17173a;
  box-shadow: 3px 3px 0 #17173a;
}
.panel-wrap > header .panel-link:hover { background: #e02a75; color: #ffffff; }

/* ===== Social Nebu: nombre del sitio siempre visible junto al logo ===== */
.site-name {
  font-family: 'Anton', Impact, sans-serif;
  font-weight: 400;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ff3d8b;
  white-space: nowrap;
  flex-shrink: 0;
}
.topbar .titles { border-left: 2px solid #ff3d8b; padding-left: 12px; min-width: 0; }

/* ===== Perfiles, filtros y llamadas ===== */
.facts { display: grid; gap: 6px; margin-top: 4px; }
.fact { display: grid; grid-template-columns: 84px 1fr; gap: 8px; font-size: 14px; }
.fact-k { color: var(--muted); font-weight: 600; }
.fact-v { word-break: break-word; }
.premium-note { margin: 0; text-align: center; font-weight: 700; color: var(--accent); }
.role-tag.premium { background: #b7791f; }
.prof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prof-grid label:last-child { grid-column: 1 / -1; }
.seeks { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; display: grid; gap: 6px; margin: 0; }
.seeks legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.filters { display: grid; gap: 6px; margin: 0 8px 10px; }
.filters select, .filters input { padding: 6px 8px; font-size: 13px; }
.call-box { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 280px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; box-shadow: 0 12px 32px rgba(20, 25, 20, 0.2); }
.call-box p { margin: 0; font-weight: 600; }
.call-modal { z-index: 35; padding: 0; }
.call-box-big { position: fixed; inset: 16px; display: grid; grid-template-rows: auto 1fr; gap: 8px; }
.call-box-big iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; background: #000; }
.call-modal .row { justify-content: flex-end; }

/* ===== Ajustes de salas en el panel ===== */
.room-list { display: grid; gap: 8px; margin: 10px 0 16px; }
.room-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); }
.room-row.is-hidden { border-style: dashed; opacity: 0.7; }
.room-name { font-size: 15px; }
.room-state { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.room-row.is-hidden .room-state { color: var(--muted); }
.room-row button { min-width: 96px; padding: 7px 12px; font-size: 13px; }
.room-cfg { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 14px; }
.room-field { display: grid; gap: 4px; font-size: 13px; min-width: 180px; }
.room-field input { width: 100%; }
.room-cfg > button { height: 42px; }
.room-add { display: flex; gap: 8px; flex-wrap: wrap; }
.room-add input { flex: 1; min-width: 200px; }
.room-add button { white-space: nowrap; }
.room-info { display: grid; gap: 2px; }
.room-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .room-row button { min-width: 0; }
}

/* Beneficios premium en el perfil */
.premium-benefits { margin-top: 12px; font-size: 13px; color: var(--muted, #666); }
.premium-benefits ul { margin: 6px 0 0; padding-left: 18px; }
.premium-benefits li { margin: 2px 0; }

/* Me gusta, match y quién vio */
.view-social { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.social-row { display: flex; gap: 8px; flex-wrap: wrap; }
.match-note { color: var(--pink, #ff3d8b); font-weight: 700; margin: 0; }
.viewers-box { margin-top: 12px; }
.viewers-list { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }

/* Respuesta citada */
.quote { display: flex; flex-direction: column; min-width: 0; margin: 2px 0 6px; padding: 4px 8px; border-left: 3px solid var(--pink, #ff3d8b); background: var(--chip, rgba(0, 0, 0, 0.06)); font-size: 13px; }
.quote span { color: var(--muted, #666); overflow-wrap: anywhere; }
.msg .reply { background: none; border: 0; padding: 0 4px; color: var(--blue, #2238c9); font: inherit; font-size: 12px; cursor: pointer; }
.msg .reply:focus-visible { outline: 2px solid var(--pink, #ff3d8b); }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 13px; background: var(--chip, #eee); border-left: 3px solid var(--pink, #ff3d8b); }
.reply-bar[hidden] { display: none; }
.reply-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#replyCancel { background: none; border: 0; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; }

/* Logo nuevo (ícono de la app) en la cabecera y el login */
img.logo {
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 8px;
  padding: 0;
  object-fit: contain;
}
.topbar img.logo { width: 38px; height: 38px; }
img.auth-logo { width: 64px; height: 64px; border-radius: 14px; }

/* Pantalla de carga mientras se conecta (evita el flash del login al cambiar de página) */
.boot { align-content: center; justify-items: center; gap: 14px; }
.boot-text { color: var(--muted, #666); font-size: 14px; margin: 0; }


/* ---------- Formato del chat ---------- */
.fmt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 6px; margin-bottom: 4px; }
.fmt-bar button { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line, #d9d4c6); border-radius: 6px; background: var(--card, #fff); color: inherit; font: inherit; font-size: 13px; cursor: pointer; line-height: 1; }
.fmt-bar button:hover:not(:disabled) { border-color: currentColor; }
.fmt-bar button:disabled { opacity: 0.4; cursor: default; }
.fmt-bar button:focus-visible { outline: 2px solid var(--pink, #ff3d8b); outline-offset: 1px; }
.fmt-bar .sw { font-size: 16px; padding: 0 4px; min-width: 26px; border: 0; background: transparent; }
.fmt-sep { width: 1px; height: 20px; background: var(--line, #d9d4c6); margin: 0 4px; }
.c-rojo { color: #e53935; }
.c-naranja { color: #f57c00; }
.c-amarillo { color: #c79a00; }
.c-verde { color: #2e9d4f; }
.c-celeste { color: #1e9bd7; }
.c-azul { color: #3b4fd3; }
.c-violeta { color: #8e3bc4; }
.c-rosa { color: #ff3d8b; }
.messages span[class^="c-"] { font-weight: inherit; }

/* Editor del chat */
.composer-input { white-space: pre-wrap; overflow-wrap: anywhere; overflow-y: auto; max-height: 120px; outline: none; color: var(--fg); cursor: text; }
.composer-input[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.composer-input.is-empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.composer-input[contenteditable="false"].is-empty::before { opacity: 0.8; }
.f-b { font-weight: 800; }
.f-i { font-style: italic; }
.f-s { text-decoration: line-through; }
.fmt-bar button[aria-pressed="true"] { background: var(--fg, #17173a); color: var(--bg, #f7f4ec); border-color: var(--fg, #17173a); }
.fmt-bar button[aria-pressed="true"] b, .fmt-bar button[aria-pressed="true"] i, .fmt-bar button[aria-pressed="true"] s { color: inherit; }

/* Colores del editor: bolitas con su color */
.fmt-bar .sw { width: 22px; height: 22px; min-width: 22px; padding: 0; border-radius: 50%; border: 2px solid var(--card, #fff); box-shadow: 0 0 0 1px var(--line, #d9d4c6); background: var(--sw); font-size: 0; }
.fmt-bar .sw:hover:not(:disabled) { transform: scale(1.12); }
.fmt-bar .sw.c-rojo { --sw: #e53935; }
.fmt-bar .sw.c-naranja { --sw: #f57c00; }
.fmt-bar .sw.c-amarillo { --sw: #e0b100; }
.fmt-bar .sw.c-verde { --sw: #2e9d4f; }
.fmt-bar .sw.c-celeste { --sw: #1e9bd7; }
.fmt-bar .sw.c-azul { --sw: #3b4fd3; }
.fmt-bar .sw.c-violeta { --sw: #8e3bc4; }
.fmt-bar .sw.c-rosa { --sw: #ff3d8b; }

/* ----- Emotes como icono (estilo WhatsApp) ----- */
.emote-chip {
  display: inline-block;
  font-size: 1.2em;
  line-height: 1;
  vertical-align: -0.15em;
  user-select: none;
  -webkit-user-select: none;
  margin: 0 1px;
}
.emote-suggest {
  position: fixed;
  z-index: 60;
  display: grid;
  min-width: 180px;
  max-width: 260px;
  padding: 4px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.emote-suggest button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.emote-suggest button.on,
.emote-suggest button:hover { background: var(--accent-soft); }
.emote-suggest .emote-chip { font-size: 1.4em; }


/* ----- Avisos flotantes y estado de envío ----- */
#status {
  position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px));
  top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 60;
  margin: 0; padding: 10px 14px; border-radius: 12px; text-align: center; font-size: 14px; font-weight: 600;
  background: #15152f; color: #ffffff; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); opacity: 1;
  opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  min-height: 0;
}
#status:empty { display: none; }
#status.show { opacity: 1; transform: none; }
#status.show { opacity: 1; }
.pending-wrap { display: grid; gap: 2px; }
.msg.pending { opacity: .65; }
.msg.pending.sending { opacity: 1; }
.send-state { font-size: 12px; color: var(--muted); text-align: right; padding: 0 4px 6px; }
.send-state.failed { color: var(--danger); font-weight: 600; }
.send-retry { background: none; border: 0; padding: 0 4px; font: inherit; font-size: 12px; font-weight: 700; color: inherit; text-decoration: underline; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { #status { transition: none; } }

/* Barra de scroll de los mensajes (Chrome / Edge / Safari) */
.messages::-webkit-scrollbar { width: 8px; }
.messages::-webkit-scrollbar-thumb { background: #c9cdc4; border-radius: 8px; }
.messages::-webkit-scrollbar-thumb:hover { background: #aeb3a8; }
.messages::-webkit-scrollbar-track { background: transparent; }

/* Bots (Nebu y Guardián) */
.role-tag.bot { background: #3a6ea5; margin-left: 4px; }
.msg.bot .nick { color: #3a6ea5; }
.msg.solo { background: rgba(58, 110, 165, .08); border-left: 3px solid #3a6ea5; border-radius: 8px; }
.msg .solo-note { font-size: 11px; color: var(--muted, #888); font-style: italic; }
.users li.user.bot .role-tag { margin-left: auto; }
.users li.user.bot { cursor: default; }
.users li.user.bot + li.user:not(.bot) { border-top: 1px solid var(--line, #e3e3e3); margin-top: 4px; padding-top: 8px; }
.users li.user.bot span { white-space: nowrap; }

/* ===== Celular: como una app de chat =====
   La pantalla no scrollea: arriba la barra, en el medio los mensajes (el único scroll) y abajo para escribir.
   Las salas (☰) y los conectados (👥) se abren como paneles que salen de los costados. */
.mob-btn, .solo-cel, .drawer-back { display: none; }
@media (max-width: 800px) {
  .solo-pc { display: none; }
  .solo-cel { display: inline; }
  .app { height: var(--app-h, 100dvh); min-height: 0; overflow: hidden; }
  .topbar { padding: 6px 8px; gap: 6px; }
  .brand { gap: 6px; flex: 1; }
  .brand .logo, .brand img.logo { width: 30px; height: 30px; }
  .site-name { display: none !important; }
  .topbar strong { font-size: 16px; }
  .top-right { gap: 6px; flex-shrink: 0; }
  .top-right .panel-link { padding: 6px 10px; font-size: 13px; }
  #nebuInstall { font-size: 0 !important; padding: 0 9px !important; height: 38px; min-width: 38px; }
  #nebuInstall::before { content: '📲'; font-size: 17px; }
  .topbar .mob-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 3px; position: relative;
    min-width: 38px; height: 38px; padding: 0 8px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--card); color: var(--ink);
    font-size: 18px; font-weight: 700; line-height: 1; flex-shrink: 0;
  }
  .topbar .mob-btn:hover { background: var(--accent-soft); }
  #usersBtn { font-size: 15px; }
  #usersBtnN { font-size: 13px; }
  .mob-dot { position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--pink, #ff3d8b); }
  .mob-dot[hidden] { display: none; }

  .layout { grid-template-columns: 1fr; padding: 6px 8px 8px; gap: 0; }
  .chat { gap: 6px; }
  .messages { flex: 1; height: auto; min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .tabs { flex-shrink: 0; }

  /* Paneles laterales */
  .side, .users {
    position: fixed; top: 0; bottom: 0; z-index: 60; width: min(84vw, 320px); max-height: none;
    border-radius: 0; overflow-y: auto; overscroll-behavior: contain;
    transition: transform .22s ease; box-shadow: 0 0 30px rgba(0, 0, 0, .25);
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .side { left: 0; transform: translateX(-105%); }
  .users { right: 0; transform: translateX(105%); }
  .app.ver-salas .side, .app.ver-gente .users { transform: none; }
  .drawer-back { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(10, 10, 30, .4); }
  .drawer-back[hidden] { display: none; }

  /* Formato en una sola fila que se desliza */
  .fmt-bar { flex-wrap: nowrap; overflow-x: auto; margin: 0; padding: 2px 2px; scrollbar-width: none; flex-shrink: 0; }
  .fmt-bar::-webkit-scrollbar { display: none; }
  .fmt-bar button { flex-shrink: 0; }
  .send { flex-shrink: 0; padding-bottom: env(safe-area-inset-bottom); }
  .send #text { font-size: 16px; } /* menos de 16px hace que el iPhone haga zoom al escribir */
  #status:empty { display: none; }
  /* La sala ya se ve en la pestaña: arriba queda lugar para los botones */
  .topbar .titles, #roomTag { display: none !important; }
  /* Mensajes: botones chicos para que el texto tenga lugar */
  .msg { gap: 8px; padding: 6px 6px; flex-wrap: wrap; }
  .msg .body { flex: 1 1 calc(100% - 48px); }
  /* Responder / Borrar / Reportar pasan a una filita abajo del texto, a la derecha */
  .msg > button { margin-top: -2px; align-self: auto; }
  .msg .body + button { margin-left: auto; }
  .msg .mod-del, .msg .reply, .msg .report { font-size: 11px; padding: 2px 6px; }
  .msg .report { opacity: .6; }
}
@media (max-width: 800px) and (prefers-reduced-motion: reduce) { .side, .users { transition: none; } }

/* ===== Videollamada ===== */
.call-box { z-index: 90; }
.call-in { display: flex; align-items: center; gap: 10px; }
.call-in p { margin: 0; }
.vcall { position: fixed; inset: 0; z-index: 95; background: #0d0d1a; color: #fff; }
.vcall[hidden] { display: none; }
#vidRemote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0d0d1a; }
#vidLocal { position: absolute; right: 14px; top: calc(14px + env(safe-area-inset-top)); width: min(28vw, 180px); aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; border: 2px solid rgba(255,255,255,.7); background: #222; transform: scaleX(-1); z-index: 2; }
.vcall-top { position: absolute; left: 16px; top: calc(14px + env(safe-area-inset-top)); display: grid; gap: 2px; text-shadow: 0 1px 4px rgba(0,0,0,.8); z-index: 2; max-width: calc(100% - 220px); }
.vcall-top strong { font-size: 20px; }
.vcall-top span { font-size: 14px; opacity: .9; }
.vcall-ctrls { position: absolute; left: 0; right: 0; bottom: calc(22px + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 16px; z-index: 2; }
.vcall-ctrls button { width: 58px; height: 58px; border-radius: 50%; border: 0; font-size: 24px; background: rgba(255,255,255,.18); backdrop-filter: blur(6px); color: #fff; cursor: pointer; }
.vcall-ctrls button.off { background: rgba(255,255,255,.9); filter: grayscale(1); }
.vcall-ctrls button.hang { background: #e53935; transform: rotate(135deg); }
.vcall-ctrls button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
body.en-llamada { overflow: hidden; }
@media (max-width: 600px) { .vcall-top { max-width: calc(100% - 150px); } .call-box { left: 12px; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom)); } }

.vcall-ctrls button.rep { width: 46px; height: 46px; font-size: 19px; align-self: center; background: rgba(0,0,0,.35); }
.vcall-rep { position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 380px); max-height: 90%; overflow-y: auto; background: var(--card, #fff); color: var(--ink, #17173a); border-radius: 16px; padding: 18px; display: grid; gap: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.vcall-rep[hidden] { display: none; }
.vcall-rep p { margin: 0 0 4px; color: var(--muted); }
.vcall-rep label { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.vcall-rep textarea { width: 100%; font: inherit; }
.vcall-rep .row { display: flex; justify-content: flex-end; gap: 8px; }
.vcall.solo-rep video, .vcall.solo-rep .vcall-ctrls, .vcall.solo-rep .vcall-top { display: none; }
.vcall-rep label { justify-content: flex-start; text-align: left; font-weight: 500; }
.vcall-rep input[type="radio"], .vcall-rep input[type="checkbox"] { width: 18px; height: 18px; min-width: 18px; flex: none; margin: 0; padding: 0; }

/* ===== Fotolog ===== */
.fotolog-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--ink, #15152f); background: var(--card); color: var(--ink); font-weight: 800; text-align: left; }
.fotolog-btn img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.fotolog-btn:hover { background: var(--accent-soft); }
.fotolog-modal { z-index: 85; padding: 0; }
.fl-box { position: fixed; inset: 16px; max-width: 820px; margin: 0 auto; background: var(--bg, #f6f4ee); border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.fl-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.fl-x { position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 17px; }
@media (max-width: 600px) { .fl-box { inset: 0; border-radius: 0; } .fl-x { top: max(10px, env(safe-area-inset-top)); } }

/* ===================== Red social: Gente, Privados y ficha de perfil ===================== */
.modos { display: flex; gap: 4px; margin: 0 auto 0 18px; }
.modos button { position: relative; border: 2px solid transparent; background: none; color: var(--s-ink, var(--ink)); font-weight: 800; padding: 7px 14px; border-radius: 999px; font-size: 14px; }
.modos button:hover { border-color: var(--s-ink, var(--ink)); }
.modos button[aria-current="page"] { background: var(--s-ink, var(--ink)); color: var(--s-paper, #fff); }
.modo-n, .abajo-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--s-pink, #ff3d8b); color: #fff; font-size: 11px; font-style: normal; font-weight: 800; }
.abajo { display: none; }

/* Vistas que reemplazan al chat en el medio */
.vista { min-width: 0; min-height: 0; overflow-y: auto; padding: 4px 2px 24px; }
.vista-cab h2 { margin: 2px 0 2px; font-size: 28px; font-weight: 900; letter-spacing: -.5px; color: var(--s-ink, var(--ink)); }
.vista-cab p { margin: 0 0 14px; }
.app.modo-gente .layout, .app.modo-privados .layout { grid-template-columns: 236px minmax(0, 1fr); }
.app.modo-gente .chat, .app.modo-gente .users, .app.modo-privados .chat, .app.modo-privados .users { display: none; }

/* Filtros */
.gente-filtros { display: grid; gap: 8px; margin-bottom: 14px; }
.gente-filtros input { width: 100%; padding: 11px 14px; border-radius: 12px; border: 2px solid var(--s-ink, var(--line)); background: var(--card); color: var(--ink); font-size: 16px; }
.chips-fila { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips-fila::-webkit-scrollbar { display: none; }
.chip-f, .chips-fila select { flex: none; padding: 7px 12px; border-radius: 999px; border: 2px solid var(--s-ink, var(--line)); background: var(--card); color: var(--ink); font-weight: 700; font-size: 13px; width: auto; }
.chip-f[aria-pressed="true"] { background: var(--s-ink, var(--ink)); color: var(--s-paper, #fff); }

/* Tarjeta "completá tu perfil" e invitados */
.completar, .invitado-gente { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; padding: 14px; margin-bottom: 14px; border-radius: 14px; border: 2px solid var(--s-ink, var(--ink)); background: var(--card); box-shadow: 4px 4px 0 var(--s-pink, #ff3d8b); }
.completar-t { display: grid; gap: 2px; }
.completar-t .muted { font-size: 13px; }
.completar-barra { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; order: 3; }
.completar-barra span { display: block; height: 100%; background: var(--s-pink, #ff3d8b); }
.invitado-gente { grid-template-columns: 1fr; }
.invitado-gente b { font-size: 18px; }
.invitado-gente p { margin: 0; }

/* Grilla de gente */
.gente-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.gcard { display: flex; flex-direction: column; border-radius: 16px; border: 2px solid var(--s-ink, var(--ink)); background: var(--card); overflow: hidden; box-shadow: 3px 3px 0 var(--s-ink, var(--ink)); transition: transform .12s, box-shadow .12s; }
.gcard:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--s-pink, #ff3d8b); }
.gfoto { position: relative; aspect-ratio: 1 / 1; padding: 0; border: 0; border-bottom: 2px solid var(--s-ink, var(--ink)); background: var(--accent-soft); cursor: pointer; overflow: hidden; }
.gfoto-in { width: 100%; height: 100%; display: grid; place-items: center; color: #fff; font-size: 64px; font-weight: 900; }
.gfoto-in img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-touch-callout: none; user-select: none; }
.gonline { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; background: rgba(255,255,255,.92); color: #146b45; font-size: 11px; font-weight: 800; }
.gonline::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #2e9d6b; box-shadow: 0 0 0 3px rgba(46,157,107,.25); }
.gneb { position: absolute; right: 8px; bottom: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 700; }
.ginfo { padding: 10px 12px 4px; display: grid; gap: 5px; flex: 1; }
.gnom { display: flex; align-items: center; gap: 4px; font-size: 16px; min-width: 0; }
.gnom b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gprem { margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: #ffb800; color: #17173a; font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.gdatos { color: var(--muted); font-size: 13px; }
.gchips { display: flex; flex-wrap: wrap; gap: 5px; }
.gchip { padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: 12px; font-weight: 700; border: 1px solid transparent; }
.gchip.comun { background: var(--s-pink, #ff3d8b); color: #fff; }
.gchip.logro { background: #fff4d6; color: #6b4a00; }
.gcomun { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--s-pink-2, #e02a75); }
.ggustos { margin: 0; font-size: 12.5px; color: var(--muted); }
.gctas { display: flex; gap: 4px; flex-wrap: wrap; }
.cta-ins { display: inline-grid; place-items: center; min-width: 24px; height: 20px; padding: 0 4px; border-radius: 5px; color: #fff; font-size: 10px; font-weight: 900; letter-spacing: .03em; }
.gacc { display: flex; gap: 6px; padding: 8px 12px 12px; }
.gbtn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 8px 10px; border-radius: 999px; border: 2px solid var(--s-ink, var(--ink)); background: var(--card); color: var(--s-ink, var(--ink)); font-weight: 800; font-size: 13px; text-decoration: none; white-space: nowrap; cursor: pointer; }
.gbtn:hover:not(:disabled) { background: var(--accent-soft); }
.gbtn.like { background: var(--s-pink, #ff3d8b); color: #fff; }
.gbtn.dado { background: #ffe1ee; color: #a3124f; }
.gbtn.match { background: linear-gradient(135deg, #ff3d8b, #ff9a3d); color: #fff; }
.gbtn:disabled { cursor: default; opacity: 1; }
.gente-mas { display: block; margin: 16px auto 0; }
.gente-vacio { grid-column: 1 / -1; display: grid; gap: 4px; text-align: center; padding: 34px 10px; }
.gente-vacio b { font-size: 17px; }
.gcard.cargando, .gcard.fantasma { min-height: 300px; background: linear-gradient(90deg, var(--card), var(--accent-soft), var(--card)); background-size: 200% 100%; animation: brillo 1.2s infinite; box-shadow: none; }
.gcard.fantasma { animation: none; filter: blur(1px); opacity: .55; }
@keyframes brillo { to { background-position: -200% 0; } }

/* Privados */
.priv-list { display: grid; gap: 2px; }
.priv { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 14px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.priv:hover { background: var(--accent-soft); }
.priv .avatar { position: relative; overflow: visible; }
.priv .avatar img { border-radius: 50%; }
.priv-on { position: absolute; right: 0; bottom: 0; width: 13px; height: 13px; border-radius: 50%; background: #2e9d6b; border: 2px solid var(--card); }
.priv-mid { flex: 1; min-width: 0; display: grid; gap: 2px; }
.priv-nom { display: flex; align-items: center; gap: 4px; }
.priv-match { font-size: 13px; }
.priv-prev { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.priv.nuevo .priv-prev { color: var(--ink); font-weight: 700; }
.priv-der { display: grid; justify-items: end; gap: 4px; }
.priv-der time { color: var(--muted); font-size: 12px; }
.priv-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--s-pink, #ff3d8b); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }

/* Ficha de perfil */
.ficha-modal { z-index: 80; }
.ficha { position: relative; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: 20px; border: 2px solid var(--s-ink, var(--ink)); background: var(--card); color: var(--ink); box-shadow: 6px 6px 0 var(--s-pink, #ff3d8b); padding: 0 0 18px; }
.ficha-x { position: absolute; z-index: 2; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 16px; }
.ficha-portada { height: 110px; }
.ficha-cab { display: flex; align-items: flex-end; gap: 14px; padding: 0 18px; margin-top: -48px; }
.ficha-ava .avatar { border: 4px solid var(--card); box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.ficha-quien { min-width: 0; padding-bottom: 6px; }
.ficha-quien h2 { margin: 0; font-size: 24px; font-weight: 900; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; overflow-wrap: anywhere; }
.ficha-quien p { margin: 2px 0 0; font-size: 14px; }
.ficha-bio { margin: 12px 18px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.ficha-acc { display: flex; gap: 8px; padding: 14px 18px 4px; }
.ficha-acc .gbtn { flex: 1; padding: 10px; font-size: 14px; }
.ficha-acc .gbtn:nth-child(n+3) { flex: none; width: 46px; }
.fsec { margin: 14px 18px 0; padding-top: 12px; border-top: 1px dashed var(--line); }
.fsec h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fsec p { margin: 0 0 8px; }
.fsec > .gbtn { margin-top: 10px; width: 100%; }
.fctas { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.fcta { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: inherit; text-decoration: none; text-align: left; cursor: pointer; min-width: 0; }
.fcta:hover { border-color: var(--s-ink, var(--ink)); }
.fcta .cta-ins { min-width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }
.fcta-t { display: grid; min-width: 0; flex: 1; }
.fcta-t small { color: var(--muted); font-size: 11px; }
.fcta-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.fcta-ir { color: var(--muted); }
.fneb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.fneb-f { aspect-ratio: 1; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #000; cursor: pointer; }
.fneb-f img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ficha-cargando { min-height: 160px; margin: 14px 18px 0; }

@media (max-width: 800px) {
  .modos { display: none; }
  /* Barra de abajo en las listas (en una sala o privado abierto se esconde) */
  .abajo { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; justify-content: space-around; padding: 4px 4px max(4px, env(safe-area-inset-bottom)); background: var(--card); border-top: 2px solid var(--s-ink, var(--ink)); }
  .abajo button { position: relative; flex: 1; display: grid; justify-items: center; gap: 1px; padding: 6px 2px; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 800; border-radius: 12px; }
  .abajo button span { font-size: 21px; line-height: 1.1; }
  .abajo button[aria-current="page"] { color: var(--s-ink, var(--ink)); background: var(--accent-soft); }
  .abajo-n { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; }
  .app.modo-chat .abajo { display: none; }
  .app:not(.modo-chat) .layout { padding-bottom: 74px; }
  .app:not(.modo-chat) #menuBtn, .app:not(.modo-chat) #usersBtn { display: none !important; }
  .app.modo-gente .layout, .app.modo-privados .layout, .app.modo-salas .layout { grid-template-columns: 1fr; }
  .app.modo-salas .chat, .app.modo-salas .users { display: none; }
  /* Salas: la lista de salas ocupa la pantalla (sin los privados, que tienen su pestaña) */
  .app.modo-salas .side { position: static; transform: none; width: auto; box-shadow: none; z-index: auto; overflow-y: auto; padding-top: 12px; }
  .app.modo-salas .side .dm-h, .app.modo-salas #dmList { display: none; }
  .app.modo-salas .drawer-back { display: none; }
  .gente-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gcard { border-radius: 14px; box-shadow: 2px 2px 0 var(--s-ink, var(--ink)); }
  .gcard:hover { transform: none; box-shadow: 2px 2px 0 var(--s-ink, var(--ink)); }
  .gfoto-in { font-size: 48px; }
  .ginfo { padding: 8px 9px 2px; }
  .gnom { font-size: 15px; }
  .gacc { flex-direction: column; padding: 6px 9px 10px; gap: 5px; }
  .gbtn { padding: 7px 8px; font-size: 12.5px; }
  .vista-cab h2 { font-size: 24px; }
  .ficha-modal { padding: 0; align-items: end; }
  .ficha { width: 100%; max-height: 94dvh; border-radius: 20px 20px 0 0; box-shadow: none; border-bottom: 0; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) { .gente-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .gcard, .gcard.cargando { transition: none; animation: none; } }

/* ===== Audios (notas de voz) ===== */
.nota { display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 6px 12px 6px 6px; width: min(270px, 100%); border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--line); }
.nota-play { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--s-pink, #ff3d8b); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; }
.nota-barra { position: relative; flex: 1; height: 6px; border-radius: 999px; background: rgba(0,0,0,.12); cursor: pointer; overflow: hidden; }
.nota-barra span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--s-pink, #ff3d8b); border-radius: 999px; }
.nota-t { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 32px; text-align: right; }
.nota.sonando .nota-play { background: var(--s-ink, #17173a); }
.mic-btn { font-size: 18px; }
.grabando { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; border: 2px solid var(--s-pink, #ff3d8b); background: var(--card); }
.grabando[hidden] { display: none; }
.grab-x, .grab-ok { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; font-size: 17px; cursor: pointer; }
.grab-x { background: var(--accent-soft); }
.grab-ok { background: var(--s-pink, #ff3d8b); color: #fff; margin-left: auto; }
.grab-punto { width: 10px; height: 10px; border-radius: 50%; background: #e53935; animation: parpadeo 1s infinite; }
@keyframes parpadeo { 50% { opacity: .2; } }
.grab-t { font-weight: 800; font-variant-numeric: tabular-nums; }
.grab-txt { color: var(--muted); font-size: 13px; }
.grab-ondas { display: inline-flex; align-items: center; gap: 3px; height: 20px; }
.grab-ondas i { width: 3px; height: 30%; border-radius: 2px; background: var(--s-pink, #ff3d8b); animation: onda 0.9s ease-in-out infinite; }
.grab-ondas i:nth-child(2) { animation-delay: .1s; } .grab-ondas i:nth-child(3) { animation-delay: .2s; } .grab-ondas i:nth-child(4) { animation-delay: .3s; }
.grab-ondas i:nth-child(5) { animation-delay: .4s; } .grab-ondas i:nth-child(6) { animation-delay: .5s; } .grab-ondas i:nth-child(7) { animation-delay: .6s; }
@keyframes onda { 50% { height: 100%; } }
.send.grabando-on { display: none; }
@media (max-width: 800px) { .grab-txt { display: none; } }
@media (prefers-reduced-motion: reduce) { .grab-punto, .grab-ondas i { animation: none; } }

/* ===== Grupos de salas (Generales, Por provincia, Por edad) ===== */
.sala-grupo { margin-bottom: 6px; }
.sala-grupo summary { cursor: pointer; list-style: none; margin: 12px 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sala-grupo summary::-webkit-details-marker { display: none; }
.sala-grupo summary::before { content: '▸'; font-size: 12px; transition: transform .15s; }
.sala-grupo[open] summary::before { transform: rotate(90deg); }
.side { overflow-y: auto; }

/* ===== Guardar mi nick ===== */
.guest-nick { display: grid; gap: 4px; margin-bottom: 8px; font-weight: 700; font-size: 14px; }
.guest-nick input { padding: 12px; border-radius: 10px; border: 2px solid #17173a; font-size: 16px; }
.guardar-card { width: min(420px, calc(100vw - 24px)); display: grid; gap: 10px; }
.guardar-card h2 { margin: 0; }
.guardar-card p { margin: 0; }
.guardar-card label:not(.check) { display: grid; gap: 4px; font-weight: 700; font-size: 14px; }
.guardar-card input:not([type=checkbox]) { padding: 11px; border-radius: 10px; border: 1px solid var(--line); font-size: 16px; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 13px; cursor: pointer; justify-self: center; }
.guardar-aviso { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 2px solid #ffb800; background: #fff8e1; color: #3a2a00; font-size: 14px; }
.guardar-aviso[hidden] { display: none; }
.guardar-aviso span { flex: 1; }
.guardar-aviso button { flex: none; padding: 6px 12px; border-radius: 999px; font-weight: 800; }

/* ===== Menciones, escribiendo, visto y reacciones ===== */
.msg.menciona { background: #fff4c2; border-left: 3px solid #ffb800; border-radius: 8px; }
.side-btn.mencion .nbadge::before { content: '@ '; }
.side-btn.mencion { box-shadow: inset 3px 0 0 #ffb800; }
.escribiendo { display: flex; align-items: center; gap: 4px; padding: 0 6px; min-height: 18px; font-size: 12.5px; color: var(--muted); font-style: italic; }
.escribiendo[hidden] { display: none; }
.escribiendo i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: salta 1s infinite; }
.escribiendo i:nth-child(2) { animation-delay: .15s; } .escribiendo i:nth-child(3) { animation-delay: .3s; margin-right: 4px; }
@keyframes salta { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
.tilde-visto { margin-left: 6px; font-size: 12px; color: var(--muted); letter-spacing: -2px; }
.tilde-visto.visto { color: #1d9bf0; font-weight: 800; }
.reacs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reacs[hidden] { display: none; }
.reac { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13px; cursor: pointer; }
.reac.mia { border-color: var(--s-pink, #ff3d8b); background: #ffe1ee; }
.react-btn { background: none; border: 0; color: var(--muted); font-size: 16px; padding: 2px 6px; cursor: pointer; opacity: .55; }
.react-btn:hover, .react-btn:focus-visible { opacity: 1; }
.reac-pop { position: fixed; z-index: 90; display: flex; gap: 2px; padding: 4px 6px; border-radius: 999px; background: var(--card); border: 2px solid var(--s-ink, #17173a); box-shadow: 3px 3px 0 var(--s-ink, #17173a); }
.reac-pop button { background: none; border: 0; font-size: 24px; padding: 4px; border-radius: 50%; cursor: pointer; transition: transform .1s; }
.reac-pop button:hover { transform: scale(1.25); }
@media (max-width: 800px) { .react-btn { display: none; } }
@media (prefers-reduced-motion: reduce) { .escribiendo i { animation: none; } }
:root[data-theme="dark"] .msg.menciona { background: #3a3110; }

/* ===== Stickers y GIFs ===== */
.emote-panel { display: block; max-height: 340px; overflow-y: auto; }
.emote-panel[hidden] { display: none; }
.ep-tabs { display: flex; gap: 6px; margin-bottom: 10px; position: sticky; top: -12px; background: var(--card); padding: 2px 0 6px; z-index: 1; }
.ep-tab { padding: 6px 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap; }
.ep-tab[aria-selected="true"] { background: var(--s-ink, #17173a); color: var(--s-paper, #fff); border-color: var(--s-ink, #17173a); }
.ep-cont.ep-emotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 8px; }
.ep-cont.ep-stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.st-pick { padding: 0; border: 0; background: none; cursor: pointer; }
.st-pick:hover .sticker { transform: rotate(-3deg) scale(1.04); }
.sticker { display: inline-grid; justify-items: center; gap: 2px; padding: 10px 14px 8px; border-radius: 16px; border: 2px solid #17173a; box-shadow: 3px 3px 0 #17173a; transform: rotate(-2deg); transition: transform .12s; margin-top: 4px; max-width: 170px; }
.sticker .st-emo { font-size: 46px; line-height: 1.05; }
.sticker .st-txt { font-family: 'Anton', Impact, sans-serif; font-size: 18px; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; text-align: center; color: #17173a; }
.sticker.chico { padding: 6px 8px 5px; width: 100%; max-width: none; }
.sticker.chico .st-emo { font-size: 30px; }
.sticker.chico .st-txt { font-size: 12px; }
.sticker.s1 { background: #ff8fbf; } .sticker.s2 { background: #ffe066; } .sticker.s3 { background: #9fd8ff; }
.sticker.s4 { background: #b5f2a8; } .sticker.s5 { background: #ffc48a; } .sticker.s6 { background: #d6c2ff; }
.gif-q { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 15px; margin-bottom: 8px; }
.gif-grilla { columns: 3 110px; column-gap: 6px; }
.gif-pick { display: block; width: 100%; padding: 0; border: 0; margin-bottom: 6px; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--accent-soft); }
.gif-pick img { width: 100%; display: block; }
.gif-pie { text-align: right; font-size: 11px; color: var(--muted); margin-top: 4px; }
.gif-msg { display: block; margin-top: 4px; max-width: 100%; height: auto; border-radius: 12px; background: var(--accent-soft); }

/* Niveles por actividad */
.nivel { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 6px; font-size: 11px; font-weight: 900; line-height: 1; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); margin-left: 4px; vertical-align: middle; cursor: default; }
.nivel.nv3 { background: #d6f5e3; color: #17173a; }
.nivel.nv4 { background: #cfe0ff; color: #17173a; }
.nivel.nv5 { background: #ffe08a; color: #17173a; }
.nivel.nv6 { background: #ff3d8b; color: #fff; }
.nivel.nv7 { background: linear-gradient(135deg, #ff3d8b, #8c5bff); color: #fff; }
.user .c-rojo, .user .c-naranja, .user .c-amarillo, .user .c-verde, .user .c-celeste, .user .c-azul, .user .c-violeta, .user .c-rosa { font-weight: 800; }

/* Pie del panel de salas: reportar un problema y reglas */
.side-pie { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 14px 6px 8px; margin-top: 10px; border-top: 1px dashed var(--line, #d9d4c6); font-size: 13px; }
.side-pie .link-btn, .side-pie a { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--muted, #6b7079); text-decoration: underline; cursor: pointer; }
.olvide-link { display: block; text-align: center; font-size: 14px; font-weight: 700; color: var(--muted, #6b7079); margin-top: 4px; }

/* Pedido de videollamada */
.pedido-box .pedido-sub { font-weight: 400; font-size: 13px; color: var(--muted, #6b7079); }
@media (max-width: 800px) { .pedido-box { bottom: calc(76px + env(safe-area-inset-bottom)); } }

/* "No soy un robot" del invitado */
.robot { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line, #d9d4c6); background: var(--card, #fff); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.robot:hover { border-color: var(--ink); }
.robot-caja { width: 22px; height: 22px; flex: none; border-radius: 5px; border: 2px solid var(--ink); background: var(--paper, #fff); display: grid; place-items: center; }
.robot.girando .robot-caja { border-color: var(--blue, #2238c9); border-right-color: transparent; border-radius: 50%; animation: robotGira .7s linear infinite; }
.robot.listo .robot-caja { background: #2e7d32; border-color: #2e7d32; }
.robot.listo .robot-caja::after { content: '✓'; color: #fff; font-size: 15px; font-weight: 900; line-height: 1; }
@keyframes robotGira { to { transform: rotate(360deg); } }
.trampa { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.robot, .robot:hover, .robot:focus, .robot:active { background: var(--card, #fff) !important; color: var(--ink) !important; box-shadow: none; }

/* Logo y nombre del chat: llevan a la portada (socialnebu.com) */
.brand-link { display: inline-flex; align-items: center; gap: inherit; color: inherit; text-decoration: none; flex: none; }
.brand-link:hover .site-name { text-decoration: underline; }
