* {
  box-sizing: border-box;
  /* Sin el recuadro celeste que pinta el navegador del celular al tocar
     algo (por ejemplo, una foto para abrirla). */
  -webkit-tap-highlight-color: transparent;
}

/* El texto de los botones no se puede seleccionar (ni al arrastrar ni con
   doble clic). */
button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"] {
  -webkit-user-select: none;
  user-select: none;
}

/* Todas las barras de scroll, en un gris claro. */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #dde1e6;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #c8cdd4;
}

/* Firefox no tiene ::-webkit-scrollbar: solo deja elegir los colores. */
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-color: #dde1e6 transparent;
  }
}

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f5f6f8;
  color: #1f2328;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Logo, foto de perfil y pill siempre en la misma línea. */
  flex-wrap: nowrap;
  gap: 12px;
  padding: 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e2e4e8;
}

.topbar h1 {
  font-size: 20px;
  margin: 0;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Íconos sueltos (sin la pill de fondo), en celeste. */
.action-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pill-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #2f9ae0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}

/* Solo con mouse: en pantallas táctiles el :hover queda "pegado" después
   de tocar, y el botón ⋯ parecía seguir activo con el menú ya cerrado. */
@media (hover: hover) {
  .pill-btn:hover {
    background: rgba(47, 154, 224, 0.12);
    color: #1a73e8;
    transform: scale(1.1);
  }
}

.pill-btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
  background: transparent;
  color: #2f9ae0;
}

@keyframes refresh-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 12px;
}

@media (max-width: 900px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }

}

.panel {
  background: #ffffff;
  border: 1px solid #e2e4e8;
  border-radius: 10px;
  padding: 16px 20px;
}

.panel h2 {
  font-size: 16px;
  margin: 0 0 12px;
}

.friends-panel,
.map-panel {
  margin: 12px 12px 0;
}

/* El panel del perfil solo existe en PC (ver más abajo, min-width: 901px). */
.friend-pane {
  display: none;
}

/* Amigo cuyo perfil se está viendo a la derecha. */
.friends-group-friend.friend-active {
  background: #e8f0fe;
  box-shadow: inset 0 0 0 1px #aecbfa;
}

.friend-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.friend-form input {
  flex: 1 1 180px;
  padding: 8px 10px;
  border: 1px solid #d7dae0;
  border-radius: 6px;
  font-size: 13px;
}

.friend-form button {
  padding: 8px 16px;
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  flex: 0 0 auto;
}

.friend-form button:hover {
  background: #1558b0;
}

.friends-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.friend-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f3f6;
  border-radius: 999px;
  padding: 6px 12px 6px 8px;
  font-size: 13px;
}

.friend-chip {
  cursor: pointer;
}

.friend-chip:hover {
  background: #e6e9ee;
}

.friend-chip:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 1px;
}

.crop-modal-actions button.danger {
  background: #fde8e6;
  color: #a8271f;
}

.crop-modal-actions button.danger:hover {
  background: #f4b8b3;
}

.friend-form button.secondary {
  background: #e2e4e8;
  color: #57606a;
}

.friend-form button.secondary:hover {
  background: #d3d6da;
}

.friend-albums {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.friend-albums:empty {
  display: none;
}

.friend-album-row {
  display: flex;
  gap: 8px;
}

.friend-album-row .friend-album-input {
  flex: 1 1 180px;
}

.remove-album-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: none;
  background: #e2e4e8;
  color: #57606a;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-album-btn:hover {
  background: #f4b8b3;
  color: #a8271f;
}

.panel h3 {
  font-size: 13px;
  color: #57606a;
  margin: 20px 0 4px;
}

.hint {
  font-size: 12px;
  color: #8a919b;
  margin: 0 0 8px;
}

.friends-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}

.friends-panel-head .friends-count {
  margin: 0;
}

.friends-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #57606a;
}

/* Mismo estilo que la pill de botones de arriba: fondo gris claro, bordes
   redondeados, sombra suave y flecha propia (sin la del navegador). */
.friends-sort-wrap {
  position: relative;
}

.friends-sort-btn {
  font: inherit;
  font-weight: 600;
  color: #1f2328;
  padding: 6px 30px 6px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f1f3f6
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2357606a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 10px center / 12px;
  box-shadow: 0 1px 2px rgba(31, 35, 40, 0.08);
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.friends-sort-btn:hover,
.friends-sort-btn[aria-expanded="true"] {
  background-color: #e7eaee;
  box-shadow: 0 2px 8px rgba(31, 35, 40, 0.12);
}

.friends-sort-btn:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 1px;
}

/* El desplegable usa el mismo menú que el ⋮ del chat (.chat-menu), abierto
   debajo del botón y alineado a su borde derecho. */
.friends-sort-menu {
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 200px;
}

.friends-sort-menu .chat-menu-item {
  position: relative;
  padding-left: 34px;
  white-space: nowrap;
}

/* Tilde en la opción elegida. */
.friends-sort-menu .chat-menu-item[aria-checked="true"] {
  font-weight: 600;
  color: #1a73e8;
}

.friends-sort-menu .chat-menu-item[aria-checked="true"]::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a73e8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    no-repeat center / contain;
}

/* El orden solo se elige en la sección de amigos. */
body:not([data-view="friends"]) .friends-sort:not(.swipe-peek *) {
  display: none;
}

.friends-count {
  font-size: 12px;
  font-weight: 600;
  color: #57606a;
  margin: 0 0 8px;
}

/* (i) al lado del contador: abre un globito con la info del plan. */
.plan-info-wrap {
  position: relative;
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
}

.plan-info-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: none;
  color: inherit;
  font: italic 700 10px/1 Georgia, serif;
  cursor: pointer;
  opacity: 0.8;
}

.plan-info-btn:hover,
.plan-info-btn[aria-expanded="true"] {
  opacity: 1;
  color: #1a73e8;
}

.plan-info-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: -8px;
  z-index: 25;
  min-width: 200px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  color: #1f2328;
  font-weight: 400;
  box-shadow: 0 4px 16px rgba(31, 35, 40, 0.18);
}

.plan-info-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}

.plan-info-list {
  margin: 0 0 8px;
  padding-left: 18px;
  color: #57606a;
}

.plan-info-more {
  font: inherit;
  font-weight: 600;
  padding: 0;
  border: 0;
  background: none;
  color: #1a73e8;
  cursor: pointer;
}

.status {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
}

.hidden {
  display: none;
}

.status.error {
  background: #fdecea;
  color: #a8271f;
  border: 1px solid #f4b8b3;
}

.status.info {
  background: #eef4fd;
  color: #1558b0;
  border: 1px solid #b9d3f7;
}

/* Avisos flotantes (ver setStatus en app.js): arriba al centro de la
   pantalla, encima de todo (también de las ventanas), sin ocupar lugar.
   Solo los avisos reciben toques; entre ellos se sigue usando la página. */
.floating-notices {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 32px));
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.floating-notice {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 6px 8px 14px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  animation: floating-notice-in 0.18s ease-out;
}

.floating-notice-text {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
  overflow-wrap: anywhere;
}

.floating-notice-text .icon {
  vertical-align: -2px;
}

.floating-notice-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

.floating-notice-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

@keyframes floating-notice-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-notice {
    animation: none;
  }
}

.email-date {
  flex-shrink: 0;
  font-size: 12px;
  color: #8a919b;
  font-weight: normal;
}

/* Asunto a la izquierda y fecha a la derecha; solo el texto del asunto
   es link, no todo el ancho de la fila. */
.email-subject-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0;
}

.email-subject {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  color: inherit;
  text-decoration: none;
}

.friend-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  /* La lista de chats se toca/clickea, no se selecciona como texto. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  /* Sin el resaltado celeste del teléfono sobre toda la tarjeta al tocar la
     foto del amigo o mantener apretado el chat. */
  -webkit-tap-highlight-color: transparent;
}

.friend-summary-list li,
.friend-summary-list li * {
  -webkit-tap-highlight-color: transparent;
}

/* Cada chat es una tarjeta: rectángulo con puntas redondeadas. */
.friend-summary-list li {
  padding: 10px 12px;
  border: 1px solid #e2e4e8;
  border-radius: 12px;
  background: #ffffff;
  margin-bottom: 8px;
}

.friend-summary-list li:last-child {
  margin-bottom: 0;
}

/* Mantener apretado un chat abre su menú (leído / no leído): que el
   teléfono no seleccione texto ni muestre su propio menú. */
@media (hover: none) {
  .friend-summary-list li[data-email] {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

.friend-summary-list li.chat-list-menu-open {
  outline: 2px solid #1a73e8;
  outline-offset: -1px;
}

.friend-summary-list li.empty {
  border: none;
  background: none;
  padding: 10px 0;
}

/* Buscador de chats. */
.chat-search-row {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-bottom: 6px;
}

.chat-search-row .chat-search {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}

.chat-search {
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 6px;
  padding: 8px 10px;
  border: 1px solid #d0d4da;
  border-radius: 14px;
  font: inherit;
  font-size: 14px;
}

.chat-search:focus {
  outline: 2px solid #f3b6c9;
  outline-offset: -1px;
  border-color: #e8457a;
}

.friend-summary-list li.search-hidden,
.albums-grid > .search-hidden,
.friends-by-mission .search-hidden {
  display: none !important;
}

.chat-search-empty {
  margin: 8px 0 0;
  font-size: 13px;
  color: #8a919b;
  text-align: center;
}

.friend-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}

.friend-summary-identity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.friend-avatar {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.friend-avatar-img {
  object-fit: cover;
  background: #e2e4e8;
}

/* Mientras se sube la foto: círculo de carga en lugar del avatar. */
.friend-avatar-loading {
  background: #f1f3f6;
}

.friend-avatar-loading .loading-circle {
  width: 70%;
  height: 70%;
  box-sizing: border-box;
  border-width: 2px;
}

/* Foto nueva que el navegador todavía está bajando: la imagen vacía gira
   como un círculo de carga (el texto alternativo queda invisible). */
.friend-avatar-img.is-loading {
  box-sizing: border-box;
  border: 2px solid #e2e4e8;
  border-top-color: #1a73e8;
  background: #f1f3f6;
  color: transparent;
  animation: refresh-spin 0.8s linear infinite;
}

.avatar-color-0 {
  background: #1a73e8;
}

.avatar-color-1 {
  background: #d93025;
}

.avatar-color-2 {
  background: #188038;
}

.avatar-color-3 {
  background: #e37400;
}

.avatar-color-4 {
  background: #9334e6;
}

.avatar-color-5 {
  background: #12736c;
}

.avatar-color-6 {
  background: #c5221f;
}

.avatar-color-7 {
  background: #3949ab;
}

.skeleton-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.skeleton-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #cbd3db;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-lines {
  flex: 1;
}

.skeleton-bar {
  height: 10px;
  border-radius: 999px;
  background: #cbd3db;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-bar-title {
  width: 45%;
  margin-bottom: 8px;
}

.skeleton-bar-subtitle {
  width: 85%;
}

/* Tarjeta de chat en espera: debajo del último mail recibido, una barra
   más corta y finita por tu último mail (como la fila chica de la tarjeta). */
.skeleton-bar-sent {
  width: 28%;
  height: 6px;
}

@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.friend-summary-name {
  font-weight: 600;
  font-size: 13px;
}

/* "Actualizando chat…": con mensajes a la vista, mientras se sincroniza. */
.chat-updating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: #57606a;
  padding: 4px 0;
}

.chat-updating.hidden {
  display: none;
}

.chat-updating .loading-circle {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

/* Avisos del chat (actualizando, errores, cargas, "Reaccionaste con…"):
   flotan arriba al centro de la conversación, sin ocupar lugar, así el
   chat no cambia de tamaño. Si hay varios, se apilan. Solo los avisos
   reciben toques: entre ellos se puede seguir tocando el chat. */
.chat-notices {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.chat-notices > * {
  pointer-events: auto;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chat-notices .status {
  margin: 0;
  padding: 6px 12px;
  border-radius: 14px;
  text-align: center;
}

/* Aviso que se va: sube y se desvanece. */
.chat-notices .status.leaving-up {
  animation: chat-notice-leave-up 0.4s ease-in forwards;
  pointer-events: none;
}

@keyframes chat-notice-leave-up {
  to {
    transform: translateY(-150%);
    opacity: 0;
  }
}

.chat-notices .chat-updating {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
}

.chat-notices .chat-react-toast {
  position: static;
  transform: none;
}

.friend-summary-lastsent {
  font-size: 11px;
  color: #8a919b;
  margin-top: 2px;
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.album-card {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #eef0f2;
  border-radius: 8px;
  overflow: hidden;
}

a.album-card.album-menu-open {
  outline: 2px solid #1a73e8;
  outline-offset: -1px;
}

/* Mantener apretado un álbum abre su menú (visto / no visto): que el
   teléfono no muestre su propio menú del link ni seleccione texto. */
@media (hover: none) {
  a.album-card {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

.album-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #e9ebee;
}

.album-info {
  padding: 6px 8px;
}

.album-card-skeleton {
  display: block;
  border: 1px solid #eef0f2;
  border-radius: 8px;
  overflow: hidden;
}

.album-skeleton-thumb {
  width: 100%;
  height: 110px;
  background: #e9ebee;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* En PC: como mucho 5 álbumes por fila, que se agrandan para llenar el
   ancho (el mínimo de 140px baja a menos columnas si no entran). La foto
   sigue el ancho de la tarjeta en vez de una altura fija. */
@media (min-width: 641px) {
  .albums-grid {
    grid-template-columns: repeat(auto-fill, minmax(max(140px, (100% - 4 * 12px) / 5), 1fr));
  }

  .album-thumb,
  .album-skeleton-thumb {
    height: auto;
    aspect-ratio: 4 / 3;
  }
}

.loader {
  width: 40px;
  height: 40px;
  position: relative;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}

.loader:before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 25px;
  height: 25px;
  transform: rotate(45deg) translate(30%, 40%);
  /* Celestes (antes naranja/rojo): la montaña de adelante más clara. */
  background: #9fd8f7;
  box-shadow: 20px -21px 0 3px #38b6f0;
  animation: album-loader-slide 2s infinite ease-in-out alternate;
}

.loader:after {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #38b6f0;
  transform: rotate(0deg);
  transform-origin: 22px 91px;
  animation: album-loader-rotate 2s infinite ease-in-out;
}

@keyframes album-loader-slide {
  0%,
  100% {
    bottom: -22px;
  }

  25%,
  75% {
    bottom: -1px;
  }

  20%,
  80% {
    bottom: 1px;
  }
}

@keyframes album-loader-rotate {
  0% {
    transform: rotate(-15deg);
  }

  25%,
  75% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(25deg);
  }
}

.album-title {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.bell-icon {
  display: block;
}

/* Campanita de novedades (álbum con cambios, correo sin leer): círculo
   celeste con la campanita blanca, como los contadores de la barra. */
.album-changed,
.email-unread {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #2f9ae0;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.album-changed .bell-icon,
.email-unread .bell-icon {
  width: 20px;
  height: 20px;
}

/* En los álbumes va sobre la esquina superior derecha de la portada. */
.album-changed {
  position: absolute;
  top: 6px;
  right: 6px;
}

/* En los correos va chiquita sobre la esquina superior derecha de la foto
   del amigo. */
.friend-summary-avatar {
  position: relative;
  flex-shrink: 0;
  display: flex;
}

.email-unread {
  position: absolute;
  top: -8px;
  right: -9px;
  width: 21px;
  height: 21px;
}

.email-unread .bell-icon {
  width: 14px;
  height: 14px;
}

.email-streak {
  margin-left: 4px;
}

.album-date {
  font-size: 11px;
  font-weight: 600;
  color: #1a73e8;
  white-space: normal;
  overflow-wrap: break-word;
  margin: 2px 0;
}

.album-subtitle {
  font-size: 11px;
  color: #8a919b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-error {
  font-size: 11px;
  color: #a8271f;
}

.empty {
  font-size: 13px;
  color: #8a919b;
}

.session-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  min-width: 0;
}

.session-info .action-icons {
  flex-shrink: 0;
}

.profile-btn {
  min-width: 0;
}


.google-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.google-avatar.hidden,
.session-initial.hidden {
  display: none;
}

/* Inicial en lugar de la foto, para cuentas sin foto de Google. */
.session-info .session-initial {
  width: 28px;
  height: 28px;
  font-size: 13px;
  color: #fff;
}

.session-info span {
  font-size: 13px;
  color: #57606a;
}

.connect-google-banner.hidden {
  display: none;
}

.connect-google-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 24px 0;
  padding: 14px 18px;
  background: #eef4fd;
  border: 1px solid #b9d3f7;
  border-radius: 10px;
  color: #1558b0;
  font-size: 14px;
}

.connect-google-banner a.connect-btn {
  padding: 8px 16px;
  background: #1a73e8;
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}

.connect-google-banner a.connect-btn:hover {
  background: #1558b0;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f6f8;
}

.login-card {
  background: #ffffff;
  border: 1px solid #e2e4e8;
  border-radius: 10px;
  padding: 32px;
  width: 100%;
  max-width: 320px;
}

.login-card h1 {
  font-size: 18px;
  margin: 0 0 20px;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-form input {
  padding: 10px 12px;
  border: 1px solid #d7dae0;
  border-radius: 6px;
  font-size: 14px;
}

.login-form button {
  padding: 10px 12px;
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 6px;
}

.login-form button:hover {
  background: #1558b0;
}

.login-form.hidden {
  display: none;
}

.login-note {
  margin: 0;
  font-size: 12px;
  color: #57606a;
  line-height: 1.4;
}

.google-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #747775;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.google-signin:hover {
  background: #f2f6fc;
}

.google-signin-logo {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.login-note-center {
  margin-top: 10px;
  text-align: center;
}

#login-form {
  margin-top: 12px;
}

.login-toggle {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: none;
  border: none;
  color: #1a73e8;
  font-size: 13px;
  cursor: pointer;
}

.login-toggle:hover {
  text-decoration: underline;
}

.login-verse {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e2e4e8;
  text-align: center;
}

.login-verse.hidden {
  display: none;
}

.login-verse-text {
  margin: 0 0 6px;
  font-size: 13px;
  font-style: italic;
  color: #57606a;
  line-height: 1.5;
}

.login-verse-ref {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #8b929c;
}

/* El fondo de los popups ocupa solo la parte visible de la pantalla
   (--vv-top / --vv-height los pone app.js): así, con el teclado del
   celular abierto, el popup queda arriba del teclado y no debajo. */
.crop-modal {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--vv-top, 0px);
  height: var(--vv-height, 100%);
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.crop-modal.hidden {
  display: none;
}

.crop-modal-content {
  background: #ffffff;
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.crop-modal-content h3 {
  margin: 0;
  font-size: 15px;
}

#crop-canvas {
  border-radius: 50%;
  background: #e2e4e8;
  cursor: grab;
  touch-action: none;
}

#crop-canvas:active {
  cursor: grabbing;
}

#crop-zoom {
  width: 280px;
}

.crop-modal-actions {
  display: flex;
  gap: 8px;
}

.crop-modal-actions button {
  padding: 8px 16px;
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.crop-modal-actions button:hover {
  background: #1558b0;
}

.crop-modal-actions button.secondary {
  background: #e2e4e8;
  color: #57606a;
}

.crop-modal-actions button.secondary:hover {
  background: #d3d6da;
}

/* Confirmación (appConfirm): encima del chat, sus menús y el visor. */
.crop-modal.app-confirm-modal {
  z-index: 1500;
  padding: 0 16px;
  box-sizing: border-box;
}

.app-confirm-content {
  width: min(360px, 100%);
  box-sizing: border-box;
  padding: 22px 20px 18px;
  gap: 10px;
  align-items: stretch;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(31, 35, 40, 0.25);
  animation: app-confirm-in 0.14s ease-out;
}

.app-confirm-content h3 {
  font-size: 17px;
  font-weight: 700;
  color: #1f2328;
}

.app-confirm-message {
  margin: 0;
  white-space: pre-line; /* los párrafos van separados con renglones vacíos */
  font-size: 14px;
  line-height: 1.45;
  color: #57606a;
}

/* "Enviando en 5 s… Cancelar" (cuando no se pide confirmación). Encima de
   todo, abajo al centro, para que se vea también con un adjunto abierto. */
.chat-send-undo {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1600;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background: #1f2328;
  color: #ffffff;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.chat-send-undo.hidden {
  display: none;
}

/* Con el cuadro del mensaje a la vista: arriba a su izquierda, con Cancelar
   primero (left y bottom los pone placeChatSendUndo en app.js). */
.chat-send-undo.over-compose {
  transform: none;
  flex-direction: row-reverse;
  padding: 8px 16px 8px 8px;
}

.chat-send-undo button {
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #8cc4ff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.chat-send-undo button:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* Barrita al pie que se va acortando mientras corre el tiempo. */
.chat-send-undo::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: #8cc4ff;
  transform-origin: left;
}

.chat-send-undo.running::after {
  animation: chat-send-undo-bar var(--undo-ms, 5000ms) linear forwards;
}

@keyframes chat-send-undo-bar {
  to {
    transform: scaleX(0);
  }
}

.app-confirm-dont-ask {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  color: #57606a;
  cursor: pointer;
  user-select: none;
}

.app-confirm-dont-ask.hidden {
  display: none;
}

.app-confirm-dont-ask input {
  margin: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.app-confirm-actions {
  justify-content: flex-end;
  margin-top: 8px;
}

.app-confirm-actions button {
  min-width: 92px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
}

@keyframes app-confirm-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

.email-dates-modal-content {
  width: 100%;
  max-width: 340px;
  max-height: 80vh;
  align-items: stretch;
}

.email-dates-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
  font-size: 12px;
  width: 100%;
}

.email-dates-list li {
  padding: 5px 0;
}

.email-dates-list a,
.email-dates-list .email-dates-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.email-dates-list a:hover {
  text-decoration: underline;
}

.email-dates-emoji {
  font-size: 14px;
}

.mail-icon {
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

.mail-icon-received {
  color: #1a73e8;
}

.mail-icon-sent {
  color: #188038;
}

.email-dates-divider {
  border-top: 1px solid #dde1e6;
  margin: 6px 0;
  padding: 0 !important;
}

.friend-info-modal-content {
  width: calc(100% - 32px);
  max-width: 340px;
  max-height: 80vh;
  overflow-y: auto;
  box-sizing: border-box;
}

#friend-info-body,
#profile-body {
  width: 100%;
}

.friend-info-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.friend-info-header .friend-avatar {
  width: 72px;
  height: 72px;
  font-size: 30px;
}

.friend-info-email {
  font-size: 12px;
  color: #57606a;
  overflow-wrap: anywhere;
  text-align: center;
}

.friend-info-details {
  margin: 0;
  font-size: 13px;
}

.friend-info-details dt {
  font-size: 11px;
  font-weight: 600;
  color: #8a919b;
  margin-top: 10px;
}

.friend-info-details dt:first-child {
  margin-top: 0;
}

.friend-info-albums {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.friend-info-albums li {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Foto del amigo con el botón de cámara en la esquina superior derecha. */
.friend-info-avatar {
  position: relative;
}

.friend-info-photo-btn {
  position: absolute;
  top: -4px;
  right: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.friend-info-photo-btn:hover,
.friend-info-photo-btn[aria-expanded="true"] {
  background: #1557b0;
}

.friend-info-photo-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.friend-info-photo-btn .icon {
  width: 15px;
  height: 15px;
}

/* El menú de la foto sale debajo, centrado respecto de la foto. */
.friend-photo-menu {
  top: calc(100% + 6px);
  right: auto;
  left: 50%;
  transform: translateX(-50%);
  min-width: 230px;
}

.chat-menu-item:disabled {
  color: #8a919b;
  cursor: default;
  background: transparent;
}

.friend-info-details dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.friend-info-details dd.friend-info-mission {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.mission-flags {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mission-flags:empty {
  display: none;
}

.mission-flags img {
  display: block;
  flex-shrink: 0;
  height: 12px;
  width: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.friend-info-details a {
  color: #1a73e8;
  text-decoration: none;
}

.friend-info-details .email-date {
  float: none;
  display: block;
}

.friend-info-details a:hover {
  text-decoration: underline;
}

/* Contadores de correos en el perfil: se tocan para ver el historial. */
.friend-info-mail-counts {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* El historial se abre desde el perfil (que también es popup): va encima. */
#email-dates-modal {
  z-index: 101;
}

.password-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 280px;
}

.password-form input {
  padding: 10px 12px;
  border: 1px solid #d7dae0;
  border-radius: 6px;
  font-size: 14px;
}

/* --- Reportar un problema o sugerencia --- */
.feedback-form {
  width: min(360px, 100%);
}

.feedback-form select,
.feedback-form textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d7dae0;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  background: #fff;
}

.feedback-form textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.4;
}

.feedback-hint {
  margin: 0;
  font-size: 12px;
  color: #57606a;
}

/* ---- Mobile (phones) ---- */
@media (max-width: 640px) {
  .topbar {
    padding: 12px 16px;
    gap: 8px;
  }

  .topbar h1 {
    font-size: 17px;
  }

  .session-info {
    gap: 6px;
  }

  .pill-btn {
    width: 30px;
    height: 30px;
  }

  .connect-google-banner {
    flex-direction: column;
    align-items: stretch;
    margin: 12px;
    padding: 12px 14px;
  }

  .connect-google-banner a.connect-btn {
    text-align: center;
  }

  .grid-layout {
    padding: 12px;
    gap: 12px;
  }

  .friends-panel,
  .map-panel {
    margin: 12px 12px 0;
  }

  .panel {
    padding: 12px 14px;
  }

  .friend-form {
    flex-direction: column;
  }

  .friend-form input,
  .friend-form button {
    flex: 0 1 auto;
    width: 100%;
  }

  .friend-form .remove-album-btn {
    flex: 0 0 auto;
    width: 28px;
  }

  .albums-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .login-card {
    padding: 24px 20px;
  }
}

/* --- Mi perfil (botón con tu foto/nombre arriba + popup) --- */
.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 2px 6px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}

.profile-btn:hover {
  background: #f0f2f5;
}

/* Tu foto (o tu inicial) arriba: igual que en la lista de chats, pasar el
   cursor la agranda un poco y tocarla abre Mi perfil. */
.profile-btn .google-avatar,
.profile-btn .session-initial {
  transition: transform 0.15s ease;
}

.profile-btn:hover .google-avatar,
.profile-btn:hover .session-initial {
  transform: scale(1.12);
}

.profile-btn:active .google-avatar,
.profile-btn:active .session-initial {
  transform: scale(1.04);
}

.profile-over-limit {
  color: #c62828;
}

.profile-names {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.profile-names h3 {
  margin: 0;
}

.profile-username {
  font-size: 12px;
  color: #57606a;
}

/* El plan en Mi perfil: se toca y abre la tienda en la pestaña Plan. */
.profile-plan-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* El mail entero, en su propio renglón abajo de "Conectado como". */
.profile-google-email {
  display: block;
  overflow-wrap: break-word;
}

/* Para que la columna del valor no se estire de más con un mail largo. */
.crop-modal .friend-info-details dd {
  min-width: 0;
}

.profile-note {
  margin: 14px 0 0;
  font-size: 12px;
  color: #8a919b;
  text-align: center;
}

/* El popup de amigo tiene 4 botones: que bajen de línea si no entran. */
.friend-info-modal-content .crop-modal-actions {
  flex-wrap: wrap;
  justify-content: center;
}

.friend-info-modal-content .crop-modal-actions button {
  padding: 8px 12px;
}

/* Eliminar y Editar: solo el ícono (el nombre queda en el title). */
.friend-info-modal-content .crop-modal-actions button.friend-info-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
}

/* Botón × para cerrar, arriba a la derecha de cada popup. */
.crop-modal-content {
  position: relative;
}

.modal-close-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #57606a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-x:hover {
  background: #f0f2f5;
  color: #24292f;
}

.email-dates-modal-content h3 {
  padding: 0 28px;
  text-align: center;
}

/* --- Mapa de amigos (sección "Mapa", ver friends-map.js) --- */
/* La página ocupa justo la pantalla y el mapa llena lo que queda debajo de
   la barra superior (en celular, hasta la barra de secciones de abajo). */
body[data-view="map"] {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body[data-view="map"] > * {
  flex-shrink: 0;
}

body[data-view="map"] .map-panel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}

.friends-map {
  position: relative;
  width: 100%;
  min-height: 0;
  /* Ocupa todo el alto que queda debajo del título. */
  flex: 1 1 auto;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #e2e4e8;
  /* Color del mar (los países se dibujan encima en el canvas). */
  background: #dbe7f1;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  /* Los pines y el popup no se salen del mapa ni tapan el botón ×. */
  isolation: isolate;
  contain: strict;
}

.friends-map:focus-visible {
  box-shadow: 0 0 0 2px #1a73e8;
}

.friends-map.is-dragging {
  cursor: grabbing;
}

.friends-map canvas {
  position: absolute;
  inset: 0;
  display: block;
}

.friends-map-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Pin: foto (o inicial) del amigo en un círculo con borde. Se posiciona con
   transform desde JS; el margen negativo lo centra en el punto. */
.friends-map-pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform;
}

.friends-map-pin:focus-visible {
  outline: none;
}

.friends-map-pin:focus-visible .friend-avatar {
  box-shadow: 0 0 0 3px #1a73e8;
}

.friends-map-pin .friend-avatar {
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  font-size: 15px;
}

.friends-map-pin img.friend-avatar {
  object-fit: cover;
  -webkit-user-drag: none;
}

/* Igual que en la lista de chats: pasar el cursor por la foto la agranda un
   poco (y queda arriba de las de al lado). Mientras se arrastra el mapa no. */
.friends-map-pin .friend-avatar {
  transition: transform 0.15s ease;
}

.friends-map:not(.is-dragging) .friends-map-pin:hover {
  z-index: 1;
}

.friends-map:not(.is-dragging) .friends-map-pin:hover .friend-avatar {
  transform: scale(1.12);
}

.friends-map:not(.is-dragging) .friends-map-pin:active .friend-avatar {
  transform: scale(1.04);
}

.friends-map-pin-count {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 9px;
  border: 2px solid #ffffff;
  background: #1a73e8;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

.friends-map-popup {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  max-width: min(260px, calc(100% - 16px));
  max-height: calc(100% - 16px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.3);
  font-size: 13px;
  line-height: 1.4;
  cursor: auto;
  user-select: text;
  -webkit-user-select: text;
}

.friends-map-popup.hidden {
  display: none;
}

.friends-map-popup hr {
  border: none;
  border-top: 1px solid #e2e4e8;
  margin: 8px 0;
}

.friends-map-zoom {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
}

.friends-map-zoom button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  background: #ffffff;
  color: #333;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.friends-map-zoom button + button {
  border-top: 1px solid #e2e4e8;
}

.friends-map-zoom button:hover {
  background: #f1f3f6;
}

.friends-map-attrib {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 1px 6px;
  border-top-left-radius: 6px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  color: #555;
}

.friends-map-attrib a {
  color: inherit;
}

/* Abajo del mapa: los amigos sin misión (no tienen pin). */
.friends-map-unplaced {
  margin: 8px 2px 0;
  font-size: 13px;
  color: #5f6368;
}

.friends-map-unplaced-friend {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: #1a73e8;
  cursor: pointer;
}

.friends-map-unplaced-friend:hover,
.friends-map-unplaced-friend:focus-visible {
  text-decoration: underline;
}

/* En pantallas táctiles, botones más grandes para el dedo. */
@media (pointer: coarse) {
  .friends-map-zoom button {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }
}

.friends-by-mission {
  font-size: 13px;
}

.friends-group-country h4 {
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #8a919b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.friends-group-mission {
  margin-bottom: 10px;
}

.friends-group-mission > a {
  color: #1a73e8;
  text-decoration: none;
  font-weight: 600;
}

.friends-group-mission > a:hover {
  text-decoration: underline;
}

.friends-by-mission ul {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.friends-group-friend {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f3f6;
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
}

.friends-group-friend:hover {
  background: #e6e9ee;
}

.friends-group-friend:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 1px;
}

.friends-group-friend .friend-avatar {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

@media (max-width: 640px) {
  body[data-view="map"] .map-panel {
    margin-bottom: 8px;
  }
}

/* Historial de correos: asunto arriba, fecha abajo. */
.email-dates-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.email-dates-subject {
  font-weight: 600;
  color: #24292f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-dates-date {
  color: #8a919b;
  font-size: 11px;
}

/* Círculo de carga del historial de correos. */
.email-dates-loading {
  display: flex;
  justify-content: center;
  padding: 24px 0 !important;
}

.loading-circle {
  width: 28px;
  height: 28px;
  border: 3px solid #e2e4e8;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: refresh-spin 0.8s linear infinite;
}

/* --- Popup "Agregar / editar amigo" ---
   Igual que el perfil de un amigo (.crop-modal .friend-info-*, más abajo):
   banda celeste con la foto y el nombre, y una tarjeta blanca con una fila
   por dato, acá con el campo para escribirlo. */
.friend-form-modal-content {
  width: calc(100% - 32px);
  max-width: 440px;
  max-height: calc(var(--vv-height, 100vh) - 24px);
  overflow-y: auto;
  box-sizing: border-box;
  align-items: stretch;
  padding: 16px;
  gap: 14px;
  border-radius: 18px;
  background: #f4f6f9;
  box-shadow: 0 10px 40px rgba(31, 35, 40, 0.25);
}

.friend-form-modal-content .friend-form-header h3 {
  padding: 0 28px;
  overflow-wrap: anywhere;
}

/* Todavía sin nombre: un ícono de persona en vez de la inicial. */
.friend-form-avatar-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dfe5ec;
  color: #8a919b;
}

.friend-form-avatar-empty .icon {
  width: 48px;
  height: 48px;
}

.friend-form-modal-content .friend-form {
  display: block;
  margin-bottom: 0;
}

.friend-form-details dt label {
  cursor: pointer;
}

.friend-form-details dd {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.friend-form-modal-content .friend-form input {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  font-size: 14px;
}

.friend-form-modal-content .friend-album-row input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.friend-form-modal-content .friend-form button.secondary {
  align-self: flex-start;
  width: auto;
  padding: 6px 12px;
}

.friend-form-modal-content .modal-close-x {
  top: 22px;
  right: 22px;
  z-index: 1;
}

.friend-form-modal-content .crop-modal-actions {
  justify-content: flex-end;
}

/* --- Vista de chat de los correos --- */
/* Con el chat activo, la tarjeta de cada amigo se puede tocar para abrirlo. */
.chat-enabled .friend-summary-list li:not(.empty):not(.skeleton-row) {
  cursor: pointer;
}

.chat-enabled .friend-summary-list li:not(.empty):not(.skeleton-row):hover {
  background: #f6f8fa;
}

.chat-modal-content {
  width: calc(100% - 32px);
  max-width: 480px;
  height: 85vh;
  box-sizing: border-box;
  align-items: stretch;
}

.chat-modal-content h3 {
  text-align: center;
  padding: 0 64px;
}

/* Foto del amigo a la izquierda de "Chat con ...". */
#chat-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

/* La foto es un botón: abre el perfil del amigo. */
.chat-title-avatar-btn {
  display: inline-flex;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.chat-title-avatar-btn:hover {
  opacity: 0.85;
}

.chat-title-avatar-btn:active {
  transform: scale(0.94);
}

.chat-title-avatar-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

#chat-title .friend-avatar {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

#chat-title .chat-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

/* ⋮ arriba del chat, al lado de la ×, con su menú. */
.chat-menu-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #57606a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-menu-btn:hover,
.chat-menu-btn[aria-expanded="true"] {
  background: #f0f2f5;
  color: #24292f;
}

.chat-menu {
  position: absolute;
  top: 42px;
  right: 8px;
  z-index: 5;
  min-width: 190px;
  padding: 6px 0;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.chat-menu-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: #1f2328;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.chat-menu-item:hover,
.chat-menu-item:focus-visible {
  background: #f1f3f6;
  outline: none;
}

/* La lista del chat y, flotando abajo a la derecha, el botón "ir al final". */
.chat-list-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Abajo a la derecha. Respondiendo a un mensaje, sube justo por encima del
   recuadro "respondiendo a…" (--reply-overlap lo pone app.js). */
.chat-to-bottom {
  position: absolute;
  right: 12px;
  bottom: calc(12px + var(--reply-overlap, 0px));
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #57606a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.chat-to-bottom:hover {
  background: #f1f3f6;
}

.chat-to-bottom.hidden {
  display: none;
}

.chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* Sin barra horizontal: lo que sea más ancho se corta o hace salto de línea. */
  overflow-x: hidden;
  overflow-wrap: anywhere;
  /* Al llegar arriba o abajo del chat, no seguir scrolleando la página. */
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 4px;
  /* Fondo elegido en Configuración → Fondo del chat (app.js siempre pone
     --chat-bg; el color es solo por si todavía no cargó). */
  background: var(--chat-bg, #d6e8f7);
  border-radius: 10px;
}

.chat-more {
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

/* Al abrir el chat, sin nada todavía: el círculo en el medio del chat. */
.chat-more.chat-first-load {
  flex: 1;
  align-items: center;
}

.chat-day {
  align-self: center;
  margin: 10px 0 4px;
  padding: 2px 10px;
  border-radius: 10px;
  /* Oscuro semitransparente con texto blanco: el fondo del chat lo elige
     cada uno (--chat-bg), y así la fecha se lee sobre cualquier color. */
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.chat-bubble {
  max-width: 80%;
  padding: 6px 10px 4px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.35;
  /* drop-shadow (no box-shadow) para que la sombra siga también la punta
     del globo (::before): con box-shadow la sombra de abajo cortaba donde
     empieza la punta y la punta se veía desalineada. */
  filter: drop-shadow(0 1px 0.5px rgba(0, 0, 0, 0.08));
}

/* Configuración → Chats → Tamaño de letra (data-chat-font en <html>). */
html[data-chat-font="small"] .chat-bubble {
  font-size: 12px;
}

html[data-chat-font="large"] .chat-bubble {
  font-size: 17px;
}

/* Muestra debajo de los botones de tamaño: dos burbujas de verdad sobre
   el fondo del chat, así cambian igual que en la conversación. */
.settings-chat-font-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 6px;
  border-radius: 10px;
  background: var(--chat-bg, #d6e8f7);
  pointer-events: none;
}

.chat-received {
  align-self: flex-start;
  background: #ffffff;
  color: #24292f;
  border-bottom-left-radius: 0;
}

.chat-sent {
  align-self: flex-end;
  background: #d2e3fc;
  color: #24292f;
  border-bottom-right-radius: 0;
}

/* Punta del globo: un triángulo que sale de la esquina de abajo, del
   color de la burbuja (background: inherit). La burbuja se corre
   8px para que la cola no quede cortada (.chat-list oculta lo
   que sale por los costados). */
.chat-bubble.chat-received,
.chat-bubble.chat-sent {
  position: relative;
}

.chat-bubble.chat-received {
  margin-left: 8px;
}

.chat-bubble.chat-sent {
  margin-right: 8px;
}

.chat-bubble.chat-received::before,
.chat-bubble.chat-sent::before {
  content: "";
  position: absolute;
  bottom: 0;
  width: 10px;
  height: 14px;
  background: inherit;
  pointer-events: none;
}

.chat-bubble.chat-received::before {
  left: -8px;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.chat-bubble.chat-sent::before {
  right: -8px;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

/* Reacciones con emoji de Gmail: pastillas montadas sobre el borde de
   abajo de la burbuja, como en WhatsApp. */
.chat-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-width: 80%;
  margin-top: -10px;
  position: relative;
  z-index: 1;
}

.chat-received-reactions {
  align-self: flex-start;
  margin-left: 18px; /* 8px de la cola de la burbuja + 10px */
}

.chat-sent-reactions {
  align-self: flex-end;
  margin-right: 18px;
}

.chat-reaction {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border: 1px solid #e2e4e8;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  font-size: 14px;
  line-height: 1.3;
  cursor: default;
}

.chat-reaction-img {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
}

.chat-reaction-mine {
  background: #e8f0fe;
  border-color: #c6dafc;
}

.chat-reaction-count {
  font-size: 11px;
  color: #57606a;
}

.chat-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Mail mostrado con su formato (HTML): los saltos de línea los dan las
   etiquetas, no el texto. */
.chat-text.chat-html {
  white-space: normal;
}

.chat-html ul,
.chat-html ol {
  margin: 4px 0;
  padding-left: 22px;
}

.chat-html blockquote {
  margin: 4px 0;
  padding-left: 10px;
  border-left: 3px solid #c0c4c9;
}

.chat-html a {
  color: #1a73e8;
}

.chat-missing {
  color: #8a919b;
  font-style: italic;
}

.chat-time {
  display: block;
  text-align: right;
  margin-top: 2px;
  font-size: 10px;
  color: #8a919b;
  /* Subrayada siempre: es el link al mail original en Gmail. */
  text-decoration: underline;
  text-underline-offset: 2px;
}

a.chat-time:hover {
  color: #57606a;
}

/* En el celu la hora no es link (Gmail web no abre el mail): sin subrayado. */
span.chat-time {
  text-decoration: none;
}

.chat-list .empty {
  text-align: center;
  color: #8a919b;
  margin: auto;
}

/* Caja para escribir un mail desde el chat */
.chat-compose {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.chat-compose.hidden,
.chat-compose .hidden,
.chat-compose-grant.hidden {
  display: none;
}

.chat-compose-mode {
  margin: 0;
  font-size: 11px;
  color: #8a919b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-compose-mode:empty {
  display: none;
}

/* Aviso de que escribir está en prueba (no admin): un mensaje por minuto. */
.chat-compose-beta {
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff4d6;
  color: #7a5a00;
  font-size: 12px;
  line-height: 1.35;
}

/* Esperando para poder mandar otro texto: el botón se ve apagado. */
#chat-compose-send.is-waiting,
#chat-attach-btn.is-waiting {
  opacity: 0.45;
}

/* Enviando: barra azul justo donde termina el fondo del chat, de punta a
   punta, que se va acortando de derecha a izquierda (rápido al principio y
   cada vez más lento, sin llegar a desaparecer hasta que el texto sale). */
.chat-send-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 3px;
  border-radius: 3px;
  background: #1a73e8;
  transform-origin: left center;
  opacity: 0;
  pointer-events: none;
}

.chat-send-bar.is-sending {
  opacity: 1;
  animation: chat-send-bar 8s cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
}

@keyframes chat-send-bar {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0.04);
  }
}

/* Ráfaga de mensajes: la barra se vacía de forma pareja hasta que sale el
   mail (duración y delay los pone chatBurst en línea). */
.chat-send-bar.is-queued {
  opacity: 1;
  animation-name: chat-send-bar-queue;
  animation-duration: 60s;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes chat-send-bar-queue {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Mensaje en cola de una ráfaga: sin el pulso del "Enviando…". */
.chat-bubble.chat-sending.chat-queued {
  opacity: 0.85;
  animation: chat-sending-in 0.25s ease-out;
}

.chat-queued .chat-sending-status {
  flex-wrap: wrap;
}

.chat-burst-now,
.chat-burst-remove {
  padding: 0 2px;
  border: 0;
  background: none;
  color: #0b57d0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* La × va afuera del globo, arriba a la izquierda (los enviados están a la
   derecha, así que del lado izquierdo siempre hay lugar). */
.chat-bubble.chat-queued {
  position: relative;
}

.chat-burst-remove {
  position: absolute;
  top: 0;
  right: calc(100% + 6px);
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: #eaeef2;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  text-align: center;
  color: #57606a;
}

.chat-burst-remove:hover {
  background: #d0d7de;
}

/* El lápiz (editar un texto en cola) va debajo de la ×, también afuera. */
.chat-burst-edit {
  position: absolute;
  top: 28px;
  right: calc(100% + 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eaeef2;
  color: #57606a;
  cursor: pointer;
}

.chat-burst-edit .icon {
  width: 13px;
  height: 13px;
}

.chat-burst-edit:hover {
  background: #d0d7de;
}

/* El globo que se está editando. */
.chat-bubble.chat-queued.is-editing {
  opacity: 1;
  outline: 2px solid #1a73e8;
  outline-offset: 1px;
}

/* Editando un mensaje en cola: solo el texto y Enviar (que guarda). La
   respuesta y el asunto son de toda la ráfaga: se ocultan mientras. */
.chat-compose.is-editing .chat-compose-reply:not(.chat-compose-edit),
.chat-compose.is-editing #chat-compose-subject,
.chat-compose.is-editing #chat-subject-btn,
.chat-compose.is-editing #chat-attach-btn,
.chat-compose.is-editing #chat-sticker-btn,
.chat-compose.is-editing #chat-record-btn {
  display: none;
}

/* Burbuja provisoria del mensaje que se está enviando. */
.chat-bubble.chat-sending {
  opacity: 0.75;
  animation: chat-sending-in 0.25s ease-out, chat-sending-pulse 1.6s ease-in-out 0.25s infinite;
}

.chat-sending-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
  color: #57606a;
}

.chat-sending-status .chat-typing-dots span {
  width: 5px;
  height: 5px;
}

@keyframes chat-sending-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
}

@keyframes chat-sending-pulse {
  50% {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-bubble.chat-sending {
    animation: none;
  }

  .chat-send-bar.is-sending {
    animation-duration: 16s;
  }
}

.chat-compose input,
.chat-compose textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d0d7de;
  border-radius: 18px;
  font: inherit;
  font-size: 14px;
  background: #ffffff;
  color: #24292f;
}

.chat-compose textarea {
  resize: none;
  /* Una línea, a la altura de los botones redondos de al lado. */
  min-height: 36px;
  /* Crece con el texto hasta ~10 líneas; después scrollea. Con el teclado
     del celular abierto (--vv-height, ver app.js) no pasa de un tercio de
     lo que se ve, para que el chat siga a la vista; pero nunca menos de
     162px (4 botones de 36px + 3 huecos de 6px), así los botones del
     costado llegan a apilarse en columna (1×4). */
  max-height: min(212px, max(162px, calc(var(--vv-height, 100vh) / 3)));
  line-height: 1.35;
}

.chat-compose input:focus,
.chat-compose textarea:focus {
  outline: 2px solid #1a73e8;
  outline-offset: -1px;
}

.chat-compose-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
}

/* El asunto (si está abierto) ocupa su propia línea arriba; abajo, el
   texto y los botones. */
.chat-compose-row #chat-compose-subject {
  flex: 1 1 100%;
  height: 36px;
}

.chat-compose-row #chat-compose-text {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

/* Recién enviado: sigue con foco (teclado abierto) pero sin cursor. */
#chat-compose-text.caret-hidden {
  caret-color: transparent;
}

/* Botones al lado del texto: una grilla cuyas columnas elige app.js
   (layoutComposeButtons) según cuánto alto ocupa el texto: 4×1, 2×2 o 1×4. */
.chat-compose-btns {
  flex: none;
  display: grid;
  grid-template-columns: repeat(var(--btn-cols, 4), 36px);
  gap: 6px;
  align-self: flex-end;
}

.chat-compose-row button {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #1a73e8;
  color: #ffffff;
  cursor: pointer;
}

.chat-compose-row button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Solo el micrófono (usuarios sin texto): a la derecha. */
.chat-compose-row {
  justify-content: flex-end;
}

.chat-compose-row .chat-record-btn {
  background: #ffffff;
  color: #1a73e8;
  border: 1px solid #d0d7de;
}

.chat-compose-row .chat-record-btn:hover {
  background: #f6f8fa;
}

/* Botón "Aa" con el campo de asunto abierto. */
.chat-compose-row .chat-subject-btn.is-active {
  background: #e8f0fe;
  border-color: #1a73e8;
}

.chat-recorder,
.chat-rec-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-recorder.hidden,
.chat-rec-preview.hidden,
.chat-attach-preview.hidden {
  display: none;
}

/* --- Deslizar un mensaje del amigo para responderlo (ver chatSwipeReply) ---
   pan-y: el scroll vertical lo sigue haciendo el navegador; el gesto para
   el costado queda para la página. */
.chat-bubble[data-reply-id] {
  touch-action: pan-y;
}

/* Ícono de responder a la izquierda de la burbuja: entra a la vista a
   medida que se la desliza, y se marca al pasar el punto de responder. */
.chat-swipe-reply-icon {
  position: absolute;
  left: -38px;
  top: 50%;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #57606a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.12s ease-out, color 0.12s;
}

.chat-swipe-reply-icon svg {
  width: 16px;
  height: 16px;
}

.chat-swipe-reply-icon.is-ready {
  color: #1a73e8;
  transform: scale(1.15);
}

/* --- ⋯ de cada mensaje (arriba a la derecha) y su menú --- */
.chat-bubble.has-menu {
  position: relative;
  padding-right: 26px;
}

.chat-msg-menu-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #8a919b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

.chat-msg-menu-btn:hover,
.chat-msg-menu-btn:focus-visible,
.chat-msg-menu-btn[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.08);
  color: #24292f;
  opacity: 1;
}

/* En el teléfono no hay ⋯: el menú se abre manteniendo apretado el
   mensaje (ver app.js). Sin selección de texto ni menú nativo del
   navegador, que taparían el nuestro (para copiar está "Copiar texto"). */
@media (hover: none) {
  .chat-bubble.has-menu {
    padding-right: 10px;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  .chat-msg-menu-btn {
    display: none;
  }
}

/* Con mouse (computadora) el ⋯ aparece solo al pasar por el mensaje, con
   el teclado o mientras su menú está abierto. Solo (hover: hover), sin
   pedir pointer: fine: las notebooks con pantalla táctil no lo cumplen y
   el ⋯ quedaba siempre visible. */
@media (hover: hover) {
  .chat-msg-menu-btn {
    opacity: 0;
    transition: opacity 0.12s;
  }

  .chat-bubble:hover > .chat-msg-menu-btn {
    opacity: 0.7;
  }

  .chat-bubble > .chat-msg-menu-btn:hover,
  .chat-msg-menu-btn:focus-visible,
  .chat-msg-menu-btn[aria-expanded="true"] {
    opacity: 1;
  }
}

.chat-msg-menu {
  position: fixed;
  z-index: 1200;
  min-width: 150px;
  padding: 4px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.chat-msg-menu.hidden {
  display: none;
}

.chat-msg-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #24292f;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.chat-msg-menu button:hover {
  background: #f1f3f4;
}

.chat-msg-menu svg {
  width: 16px;
  height: 16px;
}

/* "Eliminar para mí": en rojo, como las acciones que borran. */
.chat-msg-menu button.danger {
  color: #a8271f;
}

.chat-msg-menu button.danger:hover {
  background: #fde8e6;
}

/* "Deshacer envío" de un mensaje en cola: cuánto falta, a la derecha. */
.chat-msg-menu-time {
  margin-left: auto;
  padding-left: 12px;
  color: #57606a;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* Reacciones en el menú ⋯: fila de 6 + "+", y la grilla con más. */
.chat-msg-menu .chat-react-row,
.chat-msg-menu .chat-react-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
}

.chat-msg-menu .chat-react-row {
  flex-wrap: nowrap;
  border-bottom: 1px solid #eceef1;
  margin-bottom: 2px;
  padding-bottom: 4px;
}

.chat-msg-menu .chat-react-grid {
  display: grid;
  grid-template-columns: repeat(7, 36px);
  max-height: 200px;
  overflow-y: auto;
  border-bottom: 1px solid #eceef1;
  margin-bottom: 2px;
}

.chat-msg-menu .chat-react-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}

.chat-msg-menu .chat-react-btn .chat-reaction-img {
  width: 22px;
  height: 22px;
}

.chat-msg-menu .chat-react-btn.is-mine {
  background: #e8f0fe;
}

.chat-msg-menu .chat-react-btn:disabled {
  cursor: default;
}

.chat-msg-menu .chat-react-btn:disabled:not(.is-mine) {
  opacity: 0.4;
}

.chat-msg-menu .chat-react-btn:disabled:hover {
  background: transparent;
}

.chat-msg-menu .chat-react-btn.is-mine:disabled:hover {
  background: #e8f0fe;
}

.chat-msg-menu .chat-react-more {
  color: #57606a;
  font-size: 20px;
  font-weight: 600;
}

.chat-react-note {
  margin: 2px 8px 4px;
  max-width: 240px;
  font-size: 12px;
  color: #57606a;
}

/* Reacción que todavía no salió (5 s para cambiarla o deshacerla). */
.chat-reaction-pending {
  opacity: 0.55;
}

/* Aviso "Reaccionaste con 👍 · Deshacer" (flota con los demás avisos, ver
   .chat-notices). */
.chat-react-toast {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 24px);
  padding: 6px 8px 6px 14px;
  border-radius: 999px;
  background: #323232;
  color: #ffffff;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transform: translateX(-50%);
  white-space: nowrap;
}

.chat-react-toast.hidden {
  display: none;
}

.chat-react-toast .chat-reaction-img {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}

.chat-react-undo {
  padding: 4px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #8ab4f8;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.chat-react-undo:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* --- Respondiendo a un mensaje puntual: recuadro arriba de la caja ---
   Flota sobre el final de la lista (no ocupa lugar en la caja), así el
   chat no cambia de tamaño al elegir o cancelar a qué responder. */
.chat-compose {
  position: relative;
}

.chat-compose-reply {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 4px);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 8px;
  border-left: 3px solid #1a73e8;
  border-radius: 6px;
  background: #eef1f4;
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.12);
}

.chat-compose-reply.hidden {
  display: none;
}

.chat-compose-reply-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.chat-compose-reply-body .chat-reply-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}

.chat-compose-reply-cancel {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #57606a;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.chat-compose-reply-cancel:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* Respondiendo a un mensaje puntual, el modo y el asunto no aplican: se
   ocultan pero guardan su lugar, para que el chat no cambie de tamaño. */
.chat-compose.is-replying .chat-compose-mode {
  visibility: hidden;
}

/* Respondiendo, el asunto es el del correo: ni campo ni botón "Aa". */
.chat-compose.is-replying #chat-compose-subject,
.chat-compose.is-replying #chat-subject-btn {
  display: none;
}

/* --- Archivos elegidos con el clip --- */
.chat-attach-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-attach-summary {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

/* Barra de cuánto del límite por mail (18 MB / 10 archivos) se usó. */
.chat-attach-meter {
  height: 6px;
  border-radius: 3px;
  background: #e9edf1;
  overflow: hidden;
}

.chat-attach-meter-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: #1a73e8;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.chat-attach-meter-fill.is-near {
  background: #e3a008;
}

.chat-attach-meter-fill.is-full {
  background: #d1242f;
}

.chat-attach-note {
  margin: 0;
  font-size: 12px;
  color: #9a3412;
}

.chat-attach-note.hidden {
  display: none;
}

/* Lo que no entra en este mail: apagado y con la etiqueta "Próximo mail". */
.chat-attach-thumb.is-later {
  outline: 2px dashed #d1242f;
  outline-offset: -2px;
}

.chat-attach-thumb.is-later img,
.chat-attach-thumb.is-later video {
  opacity: 0.4;
}

.chat-attach-thumb.is-later .chat-attach-thumb-badge {
  display: none;
}

.chat-attach-thumb-later {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 2px 0;
  background: rgba(209, 36, 47, 0.85);
  color: #ffffff;
  font-size: 9px;
  font-weight: 600;
  text-align: center;
}

/* Menú del clip: fotos/videos o audios, apilados en vertical arriba de la caja
   de texto (alineados a la derecha, todos del ancho del más largo). */
.chat-attach-menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: max-content;
  margin: 0 0 6px auto;
}

.chat-attach-menu.hidden {
  display: none;
}

.chat-attach-menu-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid #d0d7de;
  border-radius: 18px;
  background: #ffffff;
  color: #24292f;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chat-attach-menu-item:hover {
  background: #f6f8fa;
}

/* Botón de stickers con el panel abierto. */
.chat-compose-row .chat-sticker-btn.is-active {
  background: #e8f0fe;
  border-color: #1a73e8;
}

/* Panel de stickers: la colección en grilla, arriba de la caja de texto. */
.chat-sticker-panel {
  margin-bottom: 6px;
  padding: 8px 10px 10px;
  border: 1px solid #d0d7de;
  border-radius: 14px;
  background: #ffffff;
}

.chat-sticker-panel.hidden {
  display: none;
}

.chat-sticker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  margin-bottom: 6px;
}

.chat-sticker-title {
  font-size: 13px;
  font-weight: 600;
  color: #57606a;
}

.chat-sticker-edit {
  padding: 4px 12px;
  border: 1px solid #d0d7de;
  border-radius: 14px;
  background: transparent;
  color: #1a73e8;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.chat-sticker-edit.hidden {
  display: none;
}

.chat-sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.chat-sticker-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #f1f3f5;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chat-sticker-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-sticker-cell:hover img {
  transform: scale(1.05);
}

.chat-sticker-new {
  flex-direction: column;
  gap: 2px;
  border: 2px dashed #b6c2cf;
  background: transparent;
  color: #1a73e8;
  font: inherit;
  font-size: 22px;
  line-height: 1;
}

.chat-sticker-new-label {
  font-size: 11px;
}

.chat-sticker-new:disabled {
  opacity: 0.5;
  cursor: default;
}

.chat-sticker-cell.is-loading > * {
  visibility: hidden;
}

.chat-sticker-cell.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  box-sizing: border-box;
  border: 3px solid #d0d4da;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: refresh-spin 0.8s linear infinite;
}

/* Recortar: la foto con un cuadrado arriba; lo de afuera, oscurecido. */
.chat-sticker-crop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.chat-sticker-crop-hint {
  margin: 0;
  font-size: 12px;
  color: #57606a;
  text-align: center;
}

.chat-sticker-crop-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  border-radius: 8px;
  line-height: 0;
  touch-action: none; /* el arrastre mueve el cuadrado, no la página */
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
}

.chat-sticker-crop-stage img {
  display: block;
  max-width: 100%;
  max-height: min(260px, 45vh);
  pointer-events: none;
}

.chat-sticker-crop-frame {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #ffffff;
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

.chat-sticker-crop-frame.is-dragging {
  cursor: grabbing;
}

.chat-sticker-crop-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(260px, 100%);
  font-size: 12px;
  color: #57606a;
}

.chat-sticker-crop-zoom input {
  flex: 1;
  min-width: 0;
}

.chat-sticker-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
}

.chat-sticker-crop-btn {
  padding: 6px 14px;
  border: 1px solid #d0d7de;
  border-radius: 16px;
  background: #ffffff;
  color: #24292f;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.chat-sticker-crop-btn.is-primary {
  border-color: #1a73e8;
  background: #1a73e8;
  color: #ffffff;
}

/* Importar de sticker.ly: link del pack y después elegir los stickers. */
.chat-sticker-import {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Marca "Testing" en el botón Importar (solo lo ven los admins). */
.chat-sticker-testing {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 5px;
  border-radius: 6px;
  background: #fff8c5;
  color: #7d4e00;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.chat-sticker-import-url {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  background: #ffffff;
  color: #24292f;
  font: inherit;
  font-size: 14px;
}

.chat-sticker-import-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-sticker-import-title {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  color: #24292f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-sticker-pick {
  outline: 2px solid transparent;
  outline-offset: -2px;
}

.chat-sticker-pick img {
  object-fit: contain;
  opacity: 0.45;
}

.chat-sticker-pick.is-selected {
  outline-color: #1a73e8;
}

.chat-sticker-pick.is-selected img {
  opacity: 1;
}

.chat-sticker-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: transparent;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.chat-sticker-pick.is-selected .chat-sticker-check {
  background: #1a73e8;
  color: #ffffff;
}

.chat-sticker-crop-btn:disabled,
.chat-sticker-edit:disabled {
  opacity: 0.5;
  cursor: default;
}

.chat-sticker-note.is-info {
  color: #1a7f37;
}

/* Editar: cada sticker con una × para borrarlo. */
.chat-sticker-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(209, 36, 47, 0.9);
  color: #ffffff;
  font-size: 16px;
  line-height: 22px;
  text-align: center;
}

.chat-sticker-panel.is-editing .chat-sticker-cell img {
  opacity: 0.75;
}

.chat-sticker-empty,
.chat-sticker-note {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  font-size: 12px;
  color: #57606a;
}

.chat-sticker-note {
  color: #d1242f;
}

.chat-sticker-note.hidden {
  display: none;
}

/* Miniaturas de lo que se va a mandar, en fila (scroll de costado). */
.chat-attach-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
}

.chat-attach-thumb {
  position: relative;
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: #e9edf1;
}

/* Reordenar arrastrando: sin el menú de "guardar imagen" ni selección. */
.chat-attach-thumb[data-index] {
  cursor: grab;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.chat-attach-thumbs.is-sorting,
.chat-attach-thumbs.is-sorting .chat-attach-thumb {
  cursor: grabbing;
}

/* El lugar donde va a quedar la miniatura mientras se arrastra. */
.chat-attach-thumb.is-placeholder {
  outline: 2px dashed #1a73e8;
  outline-offset: -2px;
}

.chat-attach-thumb.is-placeholder > * {
  opacity: 0.25;
}

/* La copia que sigue al dedo o al mouse. */
.chat-attach-thumb.chat-attach-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10000;
  margin: 0;
  pointer-events: none;
  opacity: 0.92;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  will-change: transform;
}

.chat-attach-ghost .chat-attach-thumb-remove {
  display: none;
}

.chat-attach-thumb img,
.chat-attach-thumb video {
  -webkit-user-drag: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-attach-thumb.is-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  box-sizing: border-box;
}

.chat-attach-thumb-icon {
  display: inline-flex;
  color: #57606a;
}

/* Iconos SVG en línea con el texto (reemplazan a los emojis). */
svg.ico {
  flex: none;
  vertical-align: -0.15em;
}

.chat-attach-thumb-name {
  max-width: 100%;
  font-size: 10px;
  color: #57606a;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-attach-thumb-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  z-index: 1;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-size: 10px;
}

.chat-attach-thumb-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 1;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chat-attach-add {
  border: 2px dashed #c3ccd5;
  background: transparent;
  color: #57606a;
  font-size: 26px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chat-attach-add:hover {
  background: #f6f8fa;
}

#chat-attach-text {
  resize: none;
  min-height: 36px;
  max-height: 120px;
}

.chat-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d93025;
  animation: chat-rec-pulse 1.2s ease-in-out infinite;
}

.chat-rec-time {
  flex: 1;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: #24292f;
}

/* En pausa: el punto gris y quieto, el contador apagado. */
.chat-recorder-paused .chat-rec-dot {
  background: #8a919b;
  animation: none;
}

.chat-recorder-paused .chat-rec-time {
  color: #8a919b;
}

/* Últimos 30 segundos: el contador en rojo y titilando. */
.chat-recorder-ending .chat-rec-time {
  color: #d93025;
  font-weight: 600;
  animation: chat-rec-pulse 0.8s ease-in-out infinite;
}

@keyframes chat-rec-pulse {
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-rec-dot,
  .chat-recorder-ending .chat-rec-time {
    animation: none;
  }
}

.chat-rec-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-rec-preview audio {
  width: 100%;
  height: 40px;
}

.chat-rec-progress {
  flex: 1;
  font-size: 12px;
  color: #57606a;
}

.chat-rec-primary,
.chat-rec-secondary {
  padding: 7px 14px;
  border-radius: 18px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.chat-rec-primary {
  border: none;
  background: #1a73e8;
  color: #ffffff;
}

.chat-rec-secondary {
  border: 1px solid #d0d7de;
  background: #ffffff;
  color: #24292f;
}

.chat-rec-primary:disabled,
.chat-rec-secondary:disabled {
  opacity: 0.5;
  cursor: default;
}

.chat-compose-grant {
  display: block;
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: #1a73e8;
}

/* Páginas públicas: /inicio y /privacidad */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 16px 48px;
  line-height: 1.6;
  font-size: 15px;
}

.legal-page h1 {
  font-size: 26px;
  margin: 8px 0 8px;
}

.legal-page h2 {
  font-size: 18px;
  margin: 32px 0 8px;
}

.legal-page h3 {
  font-size: 15px;
  margin: 20px 0 6px;
}

.legal-page a {
  color: #1a73e8;
}

.legal-page code {
  background: #eaecef;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}

.legal-lead {
  color: #57606a;
  margin-top: 0;
}

.legal-actions {
  margin-top: 28px;
}

.legal-button {
  display: inline-block;
  padding: 10px 18px;
  background: #1a73e8;
  color: #ffffff !important;
  border-radius: 6px;
  text-decoration: none;
}

.legal-button:hover {
  background: #1558b0;
}

button.legal-button {
  border: none;
  font: inherit;
  cursor: pointer;
}

/* Sección "Instalá la app" de /inicio */
.install-section {
  margin-top: 36px;
}

.install-actions {
  margin: 16px 0;
}

.install-note {
  padding: 10px 14px;
  background: #eef3fa;
  border-radius: 6px;
}

.legal-footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid #e2e4e8;
  font-size: 13px;
  color: #57606a;
}

.login-links {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
}

.login-links a {
  color: #57606a;
}

/* Popup "Sobre mi cuenta" */
.account-modal-content {
  position: relative;
  max-width: 420px;
}

.account-modal-content h3 {
  margin-top: 0;
}

.account-text {
  font-size: 14px;
  line-height: 1.5;
  color: #1f2328;
  margin: 0 0 12px;
}

.account-text a {
  color: #1a73e8;
}

/* --- Sesiones abiertas (Configuración → Cuenta) --- */
.settings-item-count {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 9px;
  background: #e8eaee;
  color: #57606a;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

/* Configuración → Administración: los accesos van como ítems sueltos de la
   lista (mismo espaciado que el resto). */
#admin-links:not(.hidden) {
  display: contents;
}

.settings-item-count.hidden {
  display: none;
}

.sessions-modal-content {
  width: min(460px, 100%);
  box-sizing: border-box;
}

.sessions-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  max-height: min(50vh, 360px);
  overflow-y: auto;
}

.sessions-item,
.sessions-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: #1f2328;
}

.sessions-loading {
  color: #59636e;
}

.sessions-item + .sessions-item {
  border-top: 1px solid #eef0f3;
}

.sessions-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.sessions-device {
  font-weight: 600;
}

.sessions-details {
  color: #59636e;
  overflow-wrap: anywhere;
}

.sessions-current {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 9px;
  background: #e6f4ea;
  color: #1e7e34;
  font-size: 12px;
  white-space: nowrap;
}

.sessions-revoke {
  flex-shrink: 0;
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  background: #e2e4e8;
  color: #57606a;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.sessions-revoke:hover {
  background: #d3d6da;
}

.sessions-revoke:disabled {
  opacity: 0.6;
  cursor: default;
}

/* --- Almacenamiento (menú ⋯) --- */
.storage-modal-content {
  width: min(420px, 100%);
  box-sizing: border-box;
}

.storage-modal-content .account-usage-list {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
}

/* Un poco de aire antes de "En este dispositivo". */
.account-usage-list .usage-sub + .usage-total,
.account-usage-list .usage-sub + dd + .usage-total,
.account-usage-list .usage-sub + dd + dt.usage-total + dd {
  margin-top: 8px;
}

.account-usage-list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  margin: 0;
  font-size: 13px;
  color: #1f2328;
}

.account-usage-list dt {
  margin: 0;
}

.account-usage-list dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.account-usage-list .usage-total {
  font-weight: 600;
}

.account-usage-list .usage-sub {
  padding-left: 12px;
  color: #59636e;
}

#account-delete-form.hidden,
#account-main.hidden {
  display: none;
}

.account-modal-content #account-main,
.account-modal-content .password-form {
  width: 100%;
}

/* Mapa del mundo de fondo, fijo detrás del contenido */
body.home-page::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  /* El mapa se desplaza hacia la izquierda y loopea: la capa tiene dos
     copias del mapa una al lado de la otra (repeat-x, cada una del 50% del
     ancho) y se corre exactamente una copia; al volver a 0 queda igual,
     así que no se nota el salto. Cada copia mide como "cover" de antes: lo
     que sea más grande entre el ancho de la ventana y el alto por la
     proporción del SVG (1000×394).
     Ancho de la ventana entera, contando la barra de scroll (vw): así el
     mapa no se reescala ni se corre cuando la barra aparece o desaparece
     (p.ej. en PC, Amigos scrollea la página y Gmail no). */
  width: calc(2 * max(100vw, 100vh * 1000 / 394));
  width: calc(2 * max(100vw, 100lvh * 1000 / 394));
  /* Alto de la pantalla con la barra del navegador escondida (lvh): así
     no cambia de tamaño (ni se reescala el mapa) cuando la barra aparece
     o se esconde al scrollear en el celular. */
  height: 100vh;
  height: 100lvh;
  z-index: -1;
  background-color: #e9f5fd;
  background-image: url("world-map.svg");
  background-repeat: repeat-x;
  background-size: 50% auto;
  background-position: 0 50%;
  pointer-events: none;
  /* Capa propia: el navegador la dibuja una vez y solo la mueve (transform),
     sin volver a pintar el SVG en cada cuadro. */
  transform: translate3d(0, 0, 0);
  will-change: transform;
  animation: world-map-scroll 180s linear infinite;
}

@keyframes world-map-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.home-page::before {
    animation: none;
  }
}

body.home-page .legal-page {
  position: relative;
}

/* En el login, el contenedor tiene su propio fondo gris que tapa el mapa */
body.home-page .login-page {
  background: transparent;
}

/* Adjuntos en el chat: cada archivo como un mensaje aparte con su ícono. */
.chat-file-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

/* Foto adjunta: vista previa en caja fija (así el chat no salta al
   cargar), el ícono de archivo queda de reserva por si no carga. */
.chat-photo {
  position: relative;
  display: block;
  width: min(240px, 70vw);
  height: min(240px, 70vw);
  border-radius: 10px;
  overflow: hidden;
  background: #e9ecef;
}

.chat-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* La jarra de Miss U Jars: caja con su misma forma (220×280) para verla
   completa. La imagen es transparente: se ve sobre el color del globo (las
   jarras viejas traen su propio fondo blanco). */
.chat-photo.chat-photo-jar {
  width: min(145px, 42vw);
  height: auto;
  aspect-ratio: 220 / 280;
  background: transparent;
  border-radius: 14px;
}

.chat-photo.chat-photo-jar img {
  object-fit: contain;
}

/* Globo de la jarra: del color de lo que tiene adentro (la punta del globo
   lo hereda), con un título arriba. --jar-ink es el color del título. */
.chat-bubble.chat-jar-bubble {
  --jar-bg: #ffe3ec;
  --jar-ink: #c2185b;
  background: var(--jar-bg);
  padding: 8px 10px 10px;
}

.chat-bubble.chat-jar-coins {
  --jar-bg: #fff3c9;
  --jar-ink: #9a6b00;
}

.chat-bubble.chat-jar-planes {
  --jar-bg: #dff1ff;
  --jar-ink: #1f5f99;
}

.chat-jar-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--jar-ink);
}

.chat-jar-emoji {
  font-size: 18px;
  line-height: 1;
}

.chat-jar-title {
  font-weight: 700;
  font-size: 15px;
}

/* Frase abajo de la jarra, en el mismo globo. */
.chat-jar-caption {
  margin: 8px 0 0;
  max-width: min(145px, 42vw);
  font-size: 13px;
  font-style: italic;
  line-height: 1.3;
  text-align: center;
  color: var(--jar-ink);
}

.chat-jar-count {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
}

/* Sticker en el chat: cuadrado, cada uno en su globo. 140 px en el
   celular (pantallas de hasta 400 px) y crece en línea recta con el ancho
   de la pantalla hasta 220 px (pantallas de 800 px o más):
   0,2 × ancho + 60. Igual que en el mail (_STICKER_STYLE en gmail_service). */
.chat-photo.chat-sticker {
  width: clamp(140px, calc(20vw + 60px), 220px);
  height: auto;
  aspect-ratio: 1;
  background: transparent;
}

.chat-photo.chat-sticker img {
  object-fit: contain;
}

/* Foto que todavía está cargando: círculo girando en el medio del cuadro. */
.chat-photo.is-loading img {
  visibility: hidden;
}

.chat-photo.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  box-sizing: border-box;
  border: 3px solid #d0d4da;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: refresh-spin 0.8s linear infinite;
}

/* Álbum: 3 fotos o más de un mismo mail, las primeras 4 abiertas en
   abanico como cartas en la mano. Cada carta tiene --i (su lugar, 0 a la
   izquierda) y el álbum --n (cuántas se ven); se giran desde abajo al centro. La
   última queda arriba y lleva el "+N". Al pasar el mouse se abren más. */
.chat-album {
  --fan-step: 9deg;
  --fan-shift: 18%;
  position: relative;
  width: min(240px, 70vw);
  aspect-ratio: 6 / 5;
  margin: 4px 0;
}

.chat-album .chat-album-tile {
  --fan-pos: calc(var(--i, 0) - (var(--n, 1) - 1) / 2);
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: 56%;
  height: auto;
  min-height: 0;
  aspect-ratio: 3 / 4;
  margin: 0 0 0 -28%;
  border: 3px solid #fff;
  border-radius: 10px;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  transform-origin: 50% 115%;
  transform: translateX(calc(var(--fan-pos) * var(--fan-shift))) rotate(calc(var(--fan-pos) * var(--fan-step)));
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  z-index: calc(var(--i, 0) + 1);
}

/* Lugar de cada carta (--i) y cuántas se ven (--n), sin estilos en línea
   (la CSP no los deja). */
.chat-album .chat-album-tile:nth-child(2) { --i: 1; }
.chat-album .chat-album-tile:nth-child(3) { --i: 2; }
.chat-album .chat-album-tile:nth-child(4) { --i: 3; }
.chat-album-fan-2 { --n: 2; }
.chat-album-fan-3 { --n: 3; }
.chat-album-fan-4 { --n: 4; }

.chat-album:hover {
  --fan-step: 13deg;
  --fan-shift: 26%;
}

.chat-album .chat-album-tile:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

@media (prefers-reduced-motion: reduce) {
  .chat-album .chat-album-tile {
    transition: none;
  }
}

.chat-album .chat-album-hidden {
  display: none;
}

.chat-album .chat-photo-failed img {
  visibility: hidden;
}

.chat-album-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 26px;
  font-weight: 600;
}

/* Visor de fotos: la foto grande sobre fondo oscuro y los botones abajo. */
.photo-viewer {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--vv-top, 0px);
  height: var(--vv-height, 100%);
  z-index: 200;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 16px 24px;
  box-sizing: border-box;
  overflow: hidden;
  /* El zoom (pellizco, arrastre) lo maneja la página: que el navegador no
     acerque la página entera ni la scrollee. */
  touch-action: none;
}

.photo-viewer.hidden {
  display: none;
}

.photo-viewer-img {
  max-width: 100%;
  max-height: calc(100% - 64px);
  object-fit: contain;
  border-radius: 6px;
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Durante un pellizco, la rueda o un arrastre la foto sigue al dedo sin
   demora; el doble toque sí anima. */
.photo-viewer.is-zooming .photo-viewer-img {
  transition: none;
}

.photo-viewer.is-zoomed .photo-viewer-img {
  cursor: grab;
}

.photo-viewer.is-zoomed .photo-viewer-img:active {
  cursor: grabbing;
}

/* Con la foto acercada, los botones de abajo quedan encima. */
.photo-viewer-actions {
  position: relative;
  z-index: 1;
}

.photo-viewer-close,
.photo-viewer-count {
  z-index: 1;
}

/* Foto que todavía no llegó: círculo en el medio. El lugar de la foto
   ocupa todo el alto, así los botones quedan abajo y no suben al centro. */
.photo-viewer.is-loading .photo-viewer-img {
  visibility: hidden;
  flex: 1 1 auto;
  min-height: 0;
}

.photo-viewer.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  box-sizing: border-box;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: refresh-spin 0.8s linear infinite;
}

.photo-viewer-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.photo-viewer-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Flechas para pasar de foto, a los costados y centradas en altura. */
.photo-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  padding-bottom: 4px;
  cursor: pointer;
  z-index: 1;
}

.photo-viewer-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.photo-viewer-nav.hidden {
  display: none;
}

.photo-viewer-prev {
  left: 10px;
}

.photo-viewer-next {
  right: 10px;
}

/* En el celular se pasa de foto con swipe: las flechas sobran. */
@media (max-width: 640px) {
  .photo-viewer-nav {
    display: none;
  }

  /* Sin márgenes a los costados: las fotos más anchas que la pantalla la
     ocupan entera; las más chicas quedan en su tamaño, sin agrandarse (y las
     muy altas se achican para entrar en el alto). */
  #photo-viewer {
    padding-left: 0;
    padding-right: 0;
  }

  #photo-viewer .photo-viewer-img {
    border-radius: 0;
  }
}

.photo-viewer-count {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 600;
}

.photo-viewer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Foto de perfil en grande: sin botones de descargar. */
.photo-viewer-plain .photo-viewer-actions {
  display: none;
}

/* La foto de perfil del amigo se toca para verla en grande. */
#friend-info-body .friend-info-avatar img.friend-avatar-img {
  cursor: zoom-in;
}

.photo-viewer-btn {
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.photo-viewer-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Botón solo ícono (descargar original): redondo, del alto de los otros. */
.photo-viewer-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
}

.chat-photo-bubble .chat-file-link,
.chat-photo-failed .chat-photo {
  display: none;
}

.chat-photo-failed .chat-file-link {
  display: flex;
}

a.chat-file-link:hover .chat-file-name {
  text-decoration: underline;
}

/* Audio adjunto: reproductor arriba, el link al original abajo. */
/* Ancho fijo, pero nunca más que la burbuja (si no, en celular la velocidad
   se sale por el costado). */
.chat-audio {
  width: 280px;
  max-width: 100%;
  margin-bottom: 6px;
}

@media (max-width: 640px) {
  /* En celular las burbujas pueden usar un poco más de ancho. */
  .chat-bubble,
  .chat-reactions {
    max-width: 86%;
  }

  /* Audios: que la barra de avance tenga lugar aunque el tiempo sea largo. */
  .chat-audio-bubble {
    width: 86%;
  }

  .chat-audio {
    width: 100%;
  }

  .chat-audio-row {
    gap: 8px;
  }

  .chat-audio-play {
    width: 34px;
    height: 34px;
  }

  .chat-audio-speed {
    min-width: 34px;
    padding: 2px 4px;
  }
}

.chat-audio-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-audio-play {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  cursor: pointer;
}

/* Al tocar en el celular no se pinta el recuadro de "seleccionado" del
   navegador (sale cuadrado, encima del botón redondo), ni se selecciona
   texto con un toque largo. */
.chat-audio-play,
.chat-audio-speed,
.chat-audio-seek,
.chat-transcribe-btn {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* Solo con mouse: en el celular el :hover queda "pegado" después del toque. */
@media (hover: hover) {
  .chat-audio-play:hover {
    background: #1765cc;
  }
}

.chat-audio-play:active {
  background: #1765cc;
}

.chat-audio-play:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

.chat-audio-play .loading-circle {
  width: 16px;
  height: 16px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
}

.chat-audio-seek {
  flex: 1;
  min-width: 0;
  margin: 0;
  accent-color: #1a73e8;
}

.chat-audio-seek:disabled {
  opacity: 0.5;
}

.chat-audio-time {
  flex: none;
  font-size: 12px;
  color: #57606a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chat-audio-speed {
  flex: none;
  min-width: 38px;
  padding: 2px 6px;
  border: 1px solid #c4d3ea;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: #57606a;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.chat-audio-speed.is-fast {
  border-color: #1a73e8;
  background: #1a73e8;
  color: #fff;
}

.chat-audio-speed:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

.chat-audio.is-loading .chat-audio-seek {
  display: none;
}

.chat-audio-msg {
  margin-top: 4px;
  font-size: 12px;
  color: #c5221f;
}

.chat-audio-bubble .chat-file-link {
  opacity: 0.85;
}

/* Video adjunto: portada con botón de play; al tocarlo, el reproductor. */
.chat-video {
  position: relative;
  width: min(260px, 70vw);
  min-height: 120px;
  margin-bottom: 6px;
  border-radius: 10px;
  overflow: hidden;
  background: #202124;
  cursor: pointer;
}

.chat-video-poster {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: cover;
}

.chat-video.no-poster .chat-video-poster {
  display: none;
}

.chat-video.no-poster {
  aspect-ratio: 16 / 9;
}

.chat-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 0 3px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
}

.chat-video-play svg {
  width: 24px;
  height: 24px;
}

.chat-video:hover .chat-video-play {
  background: rgba(0, 0, 0, 0.7);
}

/* Video dentro de un álbum: cuadrado como las fotos, portada recortada y
   un ▶ más chico. Va después de .chat-video para ganarle. */
.chat-album .chat-video {
  width: 56%;
  min-height: 0;
  margin: 0 0 0 -28%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
}

.chat-album .chat-video-poster {
  height: 100%;
  max-height: none;
}

.chat-album .chat-video-play {
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
}

.chat-album .chat-video-play svg {
  width: 18px;
  height: 18px;
}

/* Con "+N" encima, el ▶ no se ve (manda el número). */
.chat-album .chat-video:has(.chat-album-more) .chat-video-play {
  display: none;
}

/* Visor de video: usa el mismo fondo y botones que el de fotos. */
.video-viewer-stage {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-viewer-player,
.video-viewer-poster {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  background: #000;
}

.video-viewer.is-loading .video-viewer-poster {
  opacity: 0.5;
}

.video-viewer-msg {
  margin: 0;
  max-width: 420px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.video-viewer-msg.hidden {
  display: none;
}

/* Transcripción del audio: botón, animación mientras carga y el texto. */
.chat-transcribe-btn {
  margin-top: 6px;
  padding: 3px 10px;
  border: 1px solid #c4d3ea;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: #1a73e8;
  font-size: 12px;
  cursor: pointer;
}

.chat-transcribe-btn:hover:not(:disabled) {
  background: #e8f0fe;
}

.chat-transcribe-btn:disabled {
  color: #8a919b;
  border-color: #d0d7de;
  cursor: not-allowed;
}

.chat-transcript-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: #57606a;
}

.chat-typing-dots {
  display: inline-flex;
  gap: 3px;
}

.chat-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a73e8;
  animation: chat-typing-bounce 1.2s infinite ease-in-out;
}

.chat-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chat-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.chat-transcript-skeleton {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}

.chat-transcript-skeleton span {
  height: 9px;
  border-radius: 5px;
  background: linear-gradient(90deg, #e3e6ea 25%, #f3f4f6 50%, #e3e6ea 75%);
  background-size: 200% 100%;
  animation: chat-shimmer 1.4s infinite linear;
}

.chat-transcript-skeleton span:nth-child(2) {
  width: 85%;
}

.chat-transcript-skeleton span:nth-child(3) {
  width: 55%;
}

@keyframes chat-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.chat-transcript-text {
  margin: 6px 0 0;
  font-size: 13px;
  font-style: italic;
  color: #3d444d;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: chat-fade-in 0.35s ease-out;
}

@keyframes chat-fade-in {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
}

.chat-transcript-error {
  margin-top: 6px;
  font-size: 12px;
  color: #c5221f;
}

@media (prefers-reduced-motion: reduce) {
  .chat-typing-dots,
  .chat-transcript-skeleton {
    display: none;
  }

  .chat-transcript-text {
    animation: none;
  }
}

/* Tilde junto al tiempo: el audio ya está descargado en este dispositivo. */
.chat-audio.is-saved .chat-audio-time::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 4px;
  vertical-align: -1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23188038' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* --- Configuración --- */
.settings-modal-content {
  position: relative;
  width: min(380px, 100%);
  max-height: calc(var(--vv-height, 100vh) - 32px);
  overflow-y: auto;
  box-sizing: border-box;
  align-items: stretch;
}

/* Barra de scroll con puntas redondeadas, sin tocar las esquinas del panel. */
.settings-modal-content::-webkit-scrollbar {
  width: 8px;
}

.settings-modal-content::-webkit-scrollbar-track {
  background: transparent;
  margin: 10px 0;
}

.settings-modal-content::-webkit-scrollbar-thumb {
  background: #dde1e6;
  border-radius: 999px;
}

.settings-modal-content::-webkit-scrollbar-thumb:hover {
  background: #c8cdd4;
}

/* Firefox no permite redondear la barra: al menos la hace fina. */
@supports not selector(::-webkit-scrollbar) {
  .settings-modal-content {
    scrollbar-width: thin;
    scrollbar-color: #dde1e6 transparent;
  }
}

.settings-section + .settings-section {
  padding-top: 14px;
  border-top: 1px solid #eaecef;
}

/* Opciones de la cuenta (antes estaban en el menú ⋯) */
.settings-list {
  display: flex;
  flex-direction: column;
  margin: 0 -10px;
}

.settings-item {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: none;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  color: #1f2328;
  text-decoration: none;
  cursor: pointer;
}

.settings-item.hidden {
  display: none;
}

.settings-item:hover {
  background: #f1f3f6;
}

.settings-item-danger {
  color: #a8271f;
}

.settings-item-danger:hover {
  background: #fdecea;
}

.settings-version {
  margin: 14px 0 0;
  font-size: 12px;
  color: #8c959f;
  text-align: center;
}

.settings-modal-content h3 {
  margin-top: 0;
}

/* --- Popup de Novedades (al entrar después de una actualización) --- */
.whatsnew-content {
  width: min(440px, 100%);
}

.whatsnew-lang-note {
  margin: -6px 0 10px;
  font-size: 12px;
  color: #8c959f;
}

.whatsnew-lang-note.hidden {
  display: none;
}

.whatsnew-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.whatsnew-version + .whatsnew-version {
  padding-top: 14px;
  border-top: 1px solid #eaecef;
}

.whatsnew-version h4 {
  margin: 0;
  font-size: 15px;
}

.whatsnew-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.whatsnew-plus {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #d0d7de;
  font-size: 18px;
  line-height: 1;
  color: #57606a;
}

.whatsnew-toggle:hover .whatsnew-plus {
  background: #f3f4f6;
}

.whatsnew-details {
  margin-top: 6px;
}

.whatsnew-details[hidden] {
  display: none;
}

.whatsnew-date {
  font-weight: normal;
  font-size: 12px;
  color: #8c959f;
}

.whatsnew-name {
  display: block;
}

.whatsnew-meta {
  display: block;
  margin-top: 2px;
  font-weight: normal;
  font-size: 12px;
  color: #8c959f;
}

.whatsnew-group h5 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 4px;
  font-size: 13px;
  color: #57606a;
}

.whatsnew-group ul {
  margin: 0;
  padding-left: 18px;
}

.whatsnew-group li {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.45;
  color: #1f2328;
}

.whatsnew-content .crop-modal-actions {
  margin-top: 16px;
  justify-content: center;
}

.settings-section h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

/* Secciones que se abren al tocar el título (Idioma, Fondo del chat). */
.settings-collapsible > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  cursor: pointer;
  list-style: none;
}

.settings-collapsible > summary::-webkit-details-marker {
  display: none;
}

.settings-collapsible > summary h4 {
  margin: 0 auto 0 0;
}

.settings-summary-value {
  font-size: 13px;
  color: #57606a;
}

/* Flecha que apunta abajo cerrada y arriba abierta. */
.settings-collapsible > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: 0 4px 3px 0;
  border-right: 2px solid #57606a;
  border-bottom: 2px solid #57606a;
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.settings-collapsible[open] > summary {
  margin-bottom: 10px;
}

.settings-collapsible[open] > summary::after {
  margin-bottom: -3px;
  transform: rotate(-135deg);
}

.settings-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: #57606a;
  line-height: 1.4;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid #eaecef;
  font-size: 14px;
  cursor: pointer;
}

.settings-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #1a73e8;
}

.settings-toggle + .settings-hint {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #eaecef;
}

.settings-usage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #24292f;
}

/* Audios y fotos, uno por renglón. */
#settings-usage {
  white-space: pre-line;
}

.chat-file-icon {
  flex-shrink: 0;
}

.chat-file-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-file-name {
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.chat-file-size {
  font-size: 11px;
  color: #57606a;
}

/* Recuadro "respondiendo a…" dentro de la burbuja. */
.chat-reply {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0 0 4px;
  padding: 4px 8px;
  border: none;
  border-left: 3px solid #1a73e8;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.chat-reply:disabled {
  cursor: default;
}

.chat-sent .chat-reply {
  border-left-color: #188038;
}

.chat-reply-author {
  font-size: 12px;
  font-weight: 600;
  color: #1a73e8;
}

.chat-sent .chat-reply-author {
  color: #188038;
}

.chat-reply-text {
  font-size: 12px;
  color: #57606a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-highlight {
  animation: chat-highlight 1.6s ease-out;
}

@keyframes chat-highlight {
  0%, 30% {
    box-shadow: 0 0 0 3px #fbbc04;
  }
  100% {
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
  }
}

/* --- Navegación entre secciones: barra izquierda (PC) / inferior (celular) --- */
.view-nav {
  position: fixed;
  z-index: 50;
  display: flex;
  background: #ffffff;
  border-color: #e2e4e8;
  border-style: solid;
  border-width: 0;
}

.view-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: none;
  border-radius: 10px;
  background: none;
  color: #57606a;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.view-nav-btn[aria-current="page"] {
  color: #1a73e8;
  background: rgba(26, 115, 232, 0.12);
}

@media (hover: hover) {
  .view-nav-btn:hover {
    color: #1a73e8;
  }
}

/* Solo se ve la sección elegida. No se aplica a la copia de la sección de
   al lado que se asoma en el swipe (.swipe-peek, ver showSwipePeek). */
body[data-view="gmail"] [data-section]:not([data-section="gmail"], .swipe-peek *),
body[data-view="photos"] [data-section]:not([data-section="photos"], .swipe-peek *),
body[data-view="friends"] [data-section]:not([data-section="friends"], .swipe-peek *),
body[data-view="friends"] .grid-layout:not(.swipe-peek *),
body[data-view="map"] [data-section]:not([data-section="map"], .swipe-peek *),
body[data-view="map"] .grid-layout:not(.swipe-peek *) {
  display: none;
}

body[data-view] .grid-layout {
  /* minmax(0, ...): lo ancho de adentro (p.ej. un audio) no estira la columna. */
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 641px) {
  body[data-view] {
    padding-left: 84px;
  }

  .view-nav {
    top: 0;
    bottom: 0;
    left: 0;
    width: 84px;
    flex-direction: column;
    gap: 6px;
    padding: 76px 8px 16px;
    border-right-width: 1px;
  }

  .view-nav-btn {
    width: 100%;
    padding: 10px 4px;
  }
}

/* En PC no hay barra de arriba: el logo y el nombre van arriba de la barra
   izquierda, y Mi perfil + la pill abajo de todo, en vertical. La .topbar
   se superpone a la barra izquierda (transparente y sin tapar los clics
   de las secciones). */
@media (min-width: 641px) {
  .topbar {
    position: fixed;
    z-index: 51;
    top: 0;
    bottom: 0;
    left: 0;
    width: 84px;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    background: transparent;
    border: none;
    pointer-events: none;
  }

  .topbar > * {
    pointer-events: auto;
  }

  /* El nombre no entra en una línea en los 84px de la barra: va en dos
     ("The Mish" / "Club"), centrado. */
  .topbar h1 {
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    line-height: 1.15;
    max-width: 76px;
    white-space: normal;
    text-align: center;
  }

  .topbar .brand-logo {
    width: 32px;
    height: 32px;
  }

  .view-nav {
    padding-top: 84px;
  }

  .topbar .session-info {
    flex-direction: column;
    gap: 10px;
  }

  .topbar .profile-btn {
    padding: 2px;
  }

  .topbar .action-icons {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  /* Que el contenido que entra de costado en el swipe no ensanche la página
     (si pasa, el navegador del celular corre la barra de abajo). Va en html
     y en body porque algunos navegadores de celular ignoran el de body. Va
     siempre puesto: si se prende y apaga en cada swipe, el navegador vuelve
     a dibujar el mapa de fondo y parece que se recarga. */
  html {
    overflow-x: clip;
  }

  /* La barra de secciones no es fixed: va al final del body (que es el que
     scrollea, ver "barra de arriba y de abajo siempre quietas") y queda
     pegada abajo con sticky, igual que la de arriba. Un fixed adentro de un
     elemento que scrollea se mueve o tiembla al scrollear en el celular. */
  body[data-view] {
    display: flex;
    flex-direction: column;
    overflow-x: clip;
  }

  body[data-view] > * {
    flex-shrink: 0;
  }

  .view-nav {
    position: sticky;
    order: 1;
    margin-top: auto; /* con poco contenido, igual va abajo de todo */
    bottom: 0;
    /* Capa propia: no se vuelve a acomodar mientras el contenido se mueve. */
    transform: translateZ(0);
    justify-content: space-around;
    gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top-width: 1px;
  }

  .view-nav-btn {
    flex: 1;
    max-width: 96px;
  }

  /* Con un chat abierto se esconden la barra de arriba y la de abajo: el
     chat usa toda la pantalla y se vuelve con la ←. Sin las barras, el chat
     deja lugar para el notch y la rayita de inicio del iPhone. */
  body.chat-open[data-view="gmail"] .topbar,
  body.chat-open[data-view="gmail"] .view-nav {
    display: none;
  }

  /* "html" para ganarle al padding del bloque de ≤900px, que va más abajo. */
  html body.chat-open[data-view="gmail"] .chat-pane {
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

.view-nav-btn {
  position: relative;
}

.view-nav-badge {
  position: absolute;
  top: 2px;
  left: calc(50% + 6px);
  /* Siempre un círculo celeste, con 1, 2 o 3 caracteres ("99+"). */
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  background: #2f9ae0;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  letter-spacing: -0.02em;
  box-sizing: content-box;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.35);
}

.view-nav-badge.view-nav-badge-long {
  font-size: 8.5px;
}

.view-nav-badge.hidden {
  display: none;
}

/* Página bloqueada mientras el chat está abierto (ver lockPageScroll). */
body.scroll-locked {
  position: fixed;
  left: 0;
  right: 0;
  overflow: hidden;
}

/* Archivo de Drive que ya no existe. */
.chat-file-gone {
  opacity: 0.7;
}

.chat-file-gone .chat-file-icon {
  filter: grayscale(1);
}

.chat-file-gone .chat-file-name {
  text-decoration: line-through;
}

.chat-file-gone .chat-file-size {
  font-style: italic;
}

/* Copia de la sección vecina que se asoma al costado durante el swipe
   (ver showSwipePeek). Ocupa todo el ancho, como el bloque de verdad, y va
   de donde empieza el contenido hasta la barra de secciones (top y bottom
   los pone app.js). Es columna flex, igual que body en celular, para que
   los márgenes queden iguales. Queda debajo de las barras, el botón
   flotante y los popups. */
.swipe-peek {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
}

.swipe-peek > * {
  flex-shrink: 0;
}

/* El mapa llena el alto, como en body[data-view="map"]. */
.swipe-peek > .map-panel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

/* --- Botón flotante "Agregar amigo" (abajo a la derecha) --- */
.fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #1a73e8;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.fab:hover {
  background: #1558b0;
  transform: scale(1.06);
}

.fab:focus-visible {
  outline: 3px solid #9cc3f5;
  outline-offset: 2px;
}

/* En el celular queda arriba de la barra de secciones. */
@media (max-width: 640px) {
  .fab {
    right: 16px;
    bottom: calc(68px + 16px + env(safe-area-inset-bottom));
  }
}

/* --- Tienda --- */
.shop-modal-content {
  width: calc(100% - 32px);
  max-width: 360px;
  box-sizing: border-box;
}

#shop-modal .shop-modal-content {
  max-width: 580px;
  max-height: calc(var(--vv-height, 100vh) - 32px);
  overflow-y: auto;
  align-items: stretch;
}

#shop-modal h3 {
  text-align: center;
}

.shop-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shop-content.hidden {
  display: none;
}

.shop-tabs {
  display: flex;
  gap: 4px;
  background: #f1f3f6;
  border-radius: 8px;
  padding: 4px;
}

.shop-tab {
  flex: 1;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #57606a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.shop-tab:hover {
  color: #1f2328;
}

.shop-tab[aria-selected="true"] {
  background: #ffffff;
  color: #1a73e8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.shop-tab:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 1px;
}

.shop-intro,
.shop-muted {
  margin: 0;
  color: #57606a;
  font-size: 12px;
}

#shop-modal .status {
  margin-bottom: 0;
}

.shop-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-panel.hidden {
  display: none;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.shop-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid #e2e4e8;
  border-radius: 10px;
  padding: 12px;
}

.shop-card.current {
  border-color: #1a73e8;
  background: rgba(26, 115, 232, 0.06);
}

.shop-icon {
  display: flex;
  color: #1a73e8;
}

.shop-card-title {
  font-weight: 600;
  font-size: 14px;
  color: #1f2328;
}

.shop-desc {
  margin: 0;
  font-size: 12px;
  color: #57606a;
  flex: 1;
}

.shop-price {
  font-size: 13px;
  font-weight: 600;
  color: #1a73e8;
}

.shop-features {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: #57606a;
  flex: 1;
}

.shop-current-label {
  font-size: 12px;
  font-weight: 600;
  color: #1558b0;
  text-align: center;
  padding: 7px 0;
}

.shop-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #57606a;
}

.shop-qty-input {
  width: 56px;
  padding: 4px 6px;
  border: 1px solid #d7dae0;
  border-radius: 6px;
  font-size: 13px;
}

.shop-buy {
  padding: 7px 12px;
  background: #1a73e8;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.shop-buy:hover {
  background: #1558b0;
}

.shop-buy:disabled {
  background: #e2e4e8;
  color: #8a919b;
  cursor: default;
}

/* Tienda solo para mirar (no admins): sin el formulario para mandar regalos. */
.shop-preview .shop-field,
.shop-preview #shop-gift-mission {
  display: none;
}

.shop-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #57606a;
}

.shop-field select,
.shop-field textarea {
  padding: 8px 10px;
  border: 1px solid #d7dae0;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 400;
  color: #1f2328;
  background: #ffffff;
  resize: vertical;
}

.shop-requests-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #eef0f2;
  border-radius: 8px;
  font-size: 13px;
}

.shop-request-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shop-request-kind,
.shop-request-date {
  font-size: 11px;
  color: #8a919b;
}

.shop-request-title {
  color: #1f2328;
  overflow-wrap: anywhere;
}

.shop-request-side {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.shop-badge {
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.shop-badge-pending {
  background: #fff4d6;
  color: #8a5a00;
}

.shop-badge-approved {
  background: #e3f5e8;
  color: #1a7f37;
}

.shop-badge-rejected {
  background: #fdecea;
  color: #a8271f;
}

.shop-badge-cancelled {
  background: #f1f3f6;
  color: #57606a;
}

.shop-cancel {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: #e2e4e8;
  color: #57606a;
  font-size: 12px;
  cursor: pointer;
}

.shop-cancel:hover {
  background: #d3d6da;
}

@media (max-width: 640px) {
  .shop-grid {
    grid-template-columns: 1fr;
  }
}

/* Tarjeta de amigo esperando los datos de Gmail: nombre y foto ya, el
   resto en gris de carga. */
.friend-summary-pending .skeleton-lines {
  margin-top: 8px;
}

/* Etiqueta "Broadcast (+N)": el correo también fue a otras personas. */
.chat-broadcast {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
  font-size: 11px;
  font-style: italic;
  color: #57606a;
  cursor: help;
}

/* --- Gmail en PC: lista de chats a la izquierda, chat abierto a la derecha --- */
.chat-pane {
  display: none;
}

@media (min-width: 901px) {
  /* La página ocupa justo la pantalla: arriba la barra superior (y avisos,
     si hay) y abajo las dos columnas, que llenan el resto y scrollean cada
     una por su cuenta. Así el chat entra entero sin quedar tapado ni cortado. */
  body[data-view="gmail"] {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body[data-view="gmail"] > * {
    flex-shrink: 0;
  }

  body[data-view="gmail"] .grid-layout {
    flex: 1 1 0;
    min-height: 0;
    grid-template-columns: minmax(320px, 2fr) 3fr;
    grid-template-rows: minmax(0, 1fr);
  }

  /* El panel de la lista no scrollea: scrollea la lista de adentro, igual
     que en el chat. Así la barra de scroll queda dentro del panel y no se
     sale por la esquina redondeada. */
  body[data-view="gmail"] [data-section="gmail"]:not(.chat-pane) {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
  }

  body[data-view="gmail"] .friend-summary-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    /* Sin barra horizontal. */
    overflow-x: hidden;
    overscroll-behavior: contain;
    /* Lugar para la sombra de las tarjetas y para que la tarjeta agrandada
       al pasar el cursor no quede cortada por el borde de la zona con
       scroll. Los márgenes negativos compensan, así la lista queda donde
       estaba. */
    padding: 8px;
    margin: -8px -4px 0;
  }

  body[data-view="gmail"] .chat-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  /* Álbumes, igual que Gmail: la página ocupa justo la pantalla y scrollea
     la grilla de adentro del panel, así la barra queda dentro del bloque. */
  body[data-view="photos"] {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body[data-view="photos"] > * {
    flex-shrink: 0;
  }

  body[data-view="photos"] .grid-layout {
    flex: 1 1 0;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
  }

  body[data-view="photos"] [data-section="photos"] {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  body[data-view="photos"] .albums-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Espacio alrededor para que la tarjeta agrandada al pasar el cursor
       (scale 1.05) no quede cortada por el borde de la zona con scroll. Los
       márgenes negativos compensan, así la grilla queda donde estaba. */
    padding: 8px;
    margin: -8px -4px 0;
    align-content: start;
    /* Cada fila mide lo que su tarjeta: sin esto, con la grilla de alto fijo
       las filas se achican y se corta la info de abajo (nombre, fecha, título). */
    grid-auto-rows: max-content;
  }

  /* Amigos, igual que Gmail: la página ocupa justo la pantalla y scrollea
     la lista de adentro del panel, no la página. */
  body[data-view="friends"] {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body[data-view="friends"] > * {
    flex-shrink: 0;
  }

  /* Dos columnas: la lista de amigos y el perfil. */
  body[data-view="friends"] .friends-layout {
    flex: 1 1 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(320px, 2fr) 3fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 20px;
    margin: 12px;
  }

  body[data-view="friends"] .friends-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
  }

  body[data-view="friends"] .friend-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
  }

  .friend-pane-empty {
    margin: auto;
    color: #57606a;
    font-size: 14px;
  }

  /* Cerrado el perfil, el contenido queda dentro del panel (se reusa al
     abrir otro): hay que esconderlo, si no sigue a la vista. */
  .friend-pane-open .friend-pane-empty,
  .friend-pane:not(.friend-pane-open) .friend-info-modal-content {
    display: none;
  }

  /* El contenido del popup, puesto dentro del panel: ocupa todo el lugar,
     con una cabecera grande y los datos en filas fáciles de leer. */
  .friend-pane .friend-info-modal-content {
    flex: 1;
    width: 100%;
    max-width: none;
    max-height: none;
    padding: 0;
    gap: 18px;
    align-items: stretch;
    overflow: visible;
    background: transparent;
    box-shadow: none;
  }

  .friend-pane #friend-info-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  /* Cabecera: banda celeste con la foto grande, el nombre y el mail. */
  .friend-pane .friend-info-header {
    margin: 0;
    padding: 32px 24px 24px;
    gap: 8px;
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(207, 228, 247, 0.9), rgba(255, 255, 255, 0.85));
    box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08);
  }

  .friend-pane .friend-info-header .friend-avatar {
    width: 120px;
    height: 120px;
    font-size: 48px;
    box-shadow: 0 0 0 4px #ffffff, 0 4px 14px rgba(31, 35, 40, 0.15);
  }

  .friend-pane .friend-info-photo-btn {
    top: 0;
    right: -2px;
    width: 34px;
    height: 34px;
  }

  .friend-pane .friend-info-header h3 {
    margin-top: 6px;
    font-size: 24px;
    font-weight: 700;
    color: #1f2328;
    text-align: center;
  }

  .friend-pane .friend-info-email {
    font-size: 14px;
  }

  /* Datos: una fila por dato, la etiqueta a la izquierda y el valor a la derecha. */
  .friend-pane .friend-info-details {
    display: grid;
    grid-template-columns: minmax(140px, 200px) 1fr;
    font-size: 15px;
    line-height: 1.45;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08);
    overflow: hidden;
  }

  .friend-pane .friend-info-details dt,
  .friend-pane .friend-info-details dd {
    margin: 0;
    padding: 14px 20px;
    border-top: 1px solid #edf0f3;
  }

  .friend-pane .friend-info-details dt:first-of-type,
  .friend-pane .friend-info-details dt:first-of-type + dd {
    border-top: none;
  }

  .friend-pane .friend-info-details dt {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7480;
    display: flex;
    align-items: center;
  }

  .friend-pane .friend-info-details dd {
    color: #1f2328;
  }

  .friend-pane .friend-info-details .email-date {
    margin-top: 2px;
    font-size: 13px;
    color: #6b7480;
  }

  .friend-pane .mission-flags img {
    height: 16px;
  }

  .friend-pane .friend-info-albums {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .friend-pane .friend-info-albums a {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: #e8f0fe;
  }

  /* Editar y Eliminar, abajo y centrados. */
  .friend-pane .friend-info-modal-content .crop-modal-actions {
    margin-top: auto;
    justify-content: center;
  }

  .friend-pane .friend-info-modal-content .modal-close-x {
    top: 10px;
    right: 10px;
  }

  body[data-view="friends"] .friends-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    padding-left: 4px;
  }

  .chat-pane-empty {
    margin: auto;
    color: #57606a;
    font-size: 14px;
  }

  .chat-pane-open .chat-pane-empty,
  .chat-pane:not(.chat-pane-open) .chat-modal-content {
    display: none;
  }

  .chat-pane .chat-modal-content {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    height: auto;
    padding: 0;
    background: transparent;
  }

  .chat-pane .chat-modal-content .chat-menu-btn {
    top: -6px;
    right: -8px;
  }

  .chat-pane .chat-modal-content .chat-menu {
    top: 28px;
    right: -8px;
  }

  .chat-enabled .friend-summary-list li.chat-active:not(.empty):not(.skeleton-row),
  .chat-enabled .friend-summary-list li.chat-active:not(.empty):not(.skeleton-row):hover {
    background: #e8f0fe;
  }

  /* El botón + taparía los últimos mensajes del chat. */
  body[data-view="gmail"]:has(.chat-pane-open) .fab {
    display: none;
  }
}

/* "Leer más..." en mensajes largos. */
.chat-read-more {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  color: #1a73e8;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.chat-read-more:hover {
  text-decoration: underline;
}

/* Cantidad de correos al lado del nombre (orden "Por cantidad de mails"). */
.friends-group-extra {
  margin-left: 2px;
  color: #8a919b;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* Ícono de "enviado" en lugar del texto "Último mail tuyo". */
.friend-summary-lastsent {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lastsent-icon {
  display: inline-flex;
}

/* Asunto de tu último mail a la izquierda y hace cuánto a la
   derecha (sin link), como en la fila del último recibido. */
/* El texto no se estira; la fecha se va a la derecha sola
   con margin-left: auto. */
.lastsent-subject {
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  color: inherit;
  text-decoration: none;
}

/* Reacción a un mail de la lista de chats (la del amigo a tu último mail, o
   la tuya al último suyo): justo después del asunto (y de su "…"), sin
   achicarse, dentro de un círculo blanco con sombra. */
.lastsent-reaction {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  font-size: 11px;
  line-height: 1;
}

.lastsent-reaction .chat-reaction-img {
  width: 12px;
  height: 12px;
  vertical-align: 0;
}

.friend-summary-lastsent .email-date {
  margin-left: auto;
  padding-left: 8px;
  font-size: 11px;
}

/* Fila del último mail recibido: igual que la de tu último mail
   (.friend-summary-lastsent): letra de 11px, el mismo gris e ícono de 13px. */
.friend-summary-list .email-subject-row {
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #8a919b;
}

.lastreceived-icon {
  display: inline-flex;
}

/* Mismo tamaño que el asunto de tu último mail (.friend-summary-lastsent). */
.friend-summary-list .email-subject-row .email-subject {
  flex: 0 1 auto;
  font-size: 11px;
}

/* "(12)": cuántos mails recibidos o enviados, entre el ícono y el asunto
   del último (ver summaryCountMarkup). */
.summary-count {
  flex-shrink: 0;
  color: #57606a;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Del mismo tamaño que el asunto de al lado. */
.email-subject-row .summary-count {
  font-size: 13px;
}

.friend-summary-list .email-subject-row .summary-count {
  font-size: 11px;
}

.friend-summary-list .email-subject-row .email-date {
  font-size: 11px;
  margin-left: auto;
  padding-left: 3px;
}

/* Tarjetas de chat de alto fijo: cada fila ocupa una sola línea y lo que
   no entra (asuntos largos, nombres largos) se corta con "…". */
.friend-summary-list li:not(.empty):not(.skeleton-row) .friend-summary-name,
.friend-summary-list li:not(.empty):not(.skeleton-row) > .empty,
.friend-summary-list .email-subject,
.friend-summary-list .lastsent-subject {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}

.friend-summary-list .email-subject-row,
.friend-summary-list .friend-summary-lastsent {
  white-space: nowrap;
  min-width: 0;
}

/* Logo al lado del nombre de la app (barra de arriba, login e inicio).
   Mide un poco más que la letra del título, sea cual sea su tamaño. */
.brand {
  display: flex;
  align-items: center;
  gap: 0.45em;
}

.brand-logo {
  width: 1.6em;
  height: 1.6em;
  flex-shrink: 0;
}

.login-card h1.brand {
  justify-content: center;
}

/* Flechita curva antes del asunto en la tarjeta de Gmail: ese correo fue
   un broadcast (también lo recibieron otras personas). */
.summary-broadcast {
  display: inline-flex;
  flex-shrink: 0;
  color: #57606a;
  cursor: help;
}

/* --- Juegos --- */
.games-modal-content {
  align-items: stretch;
  max-height: calc(var(--vv-height, 100vh) - 24px);
  overflow-y: auto;
}

#games-modal h3 {
  text-align: center;
}

.games-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e2e4e8;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.game-card:hover {
  background: #f1f3f6;
  border-color: #d0d7de;
}

.game-card-icon {
  display: flex;
  flex-shrink: 0;
  color: #1a73e8;
}

.game-card-text strong {
  font-size: 14px;
  font-weight: 600;
  color: #1f2328;
}

.game-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.game-card-text small {
  color: #57606a;
  font-size: 12px;
}

/* Miss U Jars */
.jar-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.games-list.hidden,
.jar-game.hidden {
  display: none;
}

/* Adiviná el país */
.sil-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.sil-game.hidden,
.sil-game .hidden {
  display: none;
}

.sil-score {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #57606a;
}

.sil-score strong {
  font-size: 16px;
  color: #1f2328;
}

.sil-stage {
  position: relative;
  width: min(260px, 72vw);
  aspect-ratio: 1;
  border-radius: 10px;
  background: #f1f3f6;
}

#sil-svg {
  width: 100%;
  height: 100%;
  display: block;
}

#sil-shape {
  fill: #1a73e8;
  transition: fill 0.25s ease;
}

#sil-svg.is-right #sil-shape {
  fill: #1f9d55;
}

#sil-svg.is-wrong #sil-shape {
  fill: #a8271f;
}

#sil-svg.shake {
  animation: sil-shake 0.35s ease;
}

@keyframes sil-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  #sil-svg.shake {
    animation: none;
  }
}

.sil-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: #57606a;
}

.sil-hint {
  margin: 0;
  padding: 6px 12px;
  border-radius: 6px;
  background: #fff8e1;
  font-size: 13px;
  color: #6b5200;
  text-align: center;
}

.sil-msg {
  margin: 0;
  min-height: 20px;
  font-size: 14px;
  text-align: center;
  color: #57606a;
}

.sil-msg.is-right {
  color: #1f9d55;
  font-weight: 600;
}

.sil-msg.is-wrong {
  color: #a8271f;
}

.sil-form {
  display: flex;
  gap: 6px;
  width: min(320px, 100%);
}

.sil-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
}

.sil-suggest {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 4px); /* se abre hacia arriba para no tapar los botones */
  z-index: 5;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid #e2e4e8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(31, 35, 40, 0.12);
  text-align: left;
}

.sil-suggest li {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: #1f2328;
  cursor: pointer;
}

.sil-suggest li[aria-selected="true"],
.sil-suggest li:hover {
  background: #e8f0fe;
  color: #1558b0;
}

.sil-form input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid #d7dae0;
  border-radius: 6px;
  font: inherit;
  font-size: 16px; /* evita el zoom automático en iPhone */
}

.sil-form input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.sil-form button {
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  background: #1a73e8;
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.sil-form button:hover:not(:disabled) {
  background: #1558b0;
}

.sil-form button:disabled,
.sil-form input:disabled {
  opacity: 0.55;
  cursor: default;
}

.sil-actions {
  display: flex;
  gap: 8px;
}

.sil-secondary {
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  background: #e2e4e8;
  font: inherit;
  font-size: 13px;
  color: #57606a;
  cursor: pointer;
}

.sil-secondary:hover:not(:disabled) {
  background: #d3d6da;
}

.sil-secondary:disabled {
  opacity: 0.5;
  cursor: default;
}

.jar-click.sil-next {
  background: #1a73e8;
}

.jar-click.sil-next:hover {
  background: #1558b0;
}

.sil-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.sil-end-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1f2328;
}

.sil-end-best {
  margin: 0 0 6px;
  font-size: 14px;
  color: #57606a;
}

/* Adiviná el apóstol (usa también las clases .sil-* de arriba) */
.apo-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.apo-frame {
  position: relative;
  width: min(210px, 56vw);
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f3f6;
}

#apo-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flg-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(300px, 80vw);
  aspect-ratio: 3 / 2;
}

#flg-photo {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}

.apo-credit {
  max-width: min(320px, 100%);
  font-size: 11px;
  line-height: 1.35;
  color: #8a919b;
  text-align: center;
  overflow-wrap: anywhere;
}

.apo-credit a {
  color: inherit;
}

.apo-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: min(380px, 100%);
}

@media (max-width: 360px) {
  .apo-options {
    grid-template-columns: 1fr;
  }
}

.apo-option {
  padding: 9px 8px;
  border: 1px solid #d7dae0;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #1f2328;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.apo-option:hover:not(:disabled) {
  border-color: #1a73e8;
  background: #e8f0fe;
}

.apo-option:disabled {
  cursor: default;
  opacity: 0.6;
}

.apo-option.is-right {
  opacity: 1;
  border-color: #1f9d55;
  background: #e6f6ec;
  color: #14713c;
}

.apo-option.is-wrong {
  opacity: 1;
  border-color: #a8271f;
  background: #fdecea;
  color: #a8271f;
}

.jar-back {
  align-self: flex-start;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: #57606a;
  cursor: pointer;
}

.jar-back:hover {
  color: #1f2328;
}

/* El contador se ve en la etiqueta de la jarra (dentro del SVG); este
   texto queda solo para lectores de pantalla. */
.jar-count-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.jar-stage {
  position: relative;
  width: min(220px, 70vw);
  aspect-ratio: 220 / 280;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  /* Sin zoom por doble toque: se puede tocar rápido. */
  touch-action: manipulation;
}

.jar-back-layer,
.jar-front-layer,
.jar-hearts {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.jar-front-layer {
  pointer-events: none;
}

.jar-heart {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}

.jar-full {
  margin: 0;
  max-width: 100%;
  font-size: 13px;
  line-height: 1.3;
  color: #1a73e8;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hasta que se llena, el aviso no se ve pero guarda su lugar: la ventana
   del juego no cambia de alto. */
.jar-full.hidden {
  display: block;
  visibility: hidden;
}

/* Explicación del juego, abajo de la jarra. */
.jar-help {
  margin: 0;
  max-width: 280px;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  color: #57606a;
}

.jar-stage:focus {
  outline: none;
}

.jar-stage:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 4px;
  border-radius: 12px;
}

/* Lugar del botón "Enviar a amigos" (o del link para dar permiso): siempre
   del mismo alto, aunque no haya ninguno de los dos. */
.jar-send-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  max-width: 100%;
  text-align: center;
}

.jar-send-slot .chat-compose-grant {
  margin-top: 0;
}

.jar-click {
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  background: #1a73e8;
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 0.08s ease, background 0.15s ease;
}

.jar-click:hover {
  background: #1558b0;
}

.jar-click:active {
  transform: scale(0.94);
}

/* Miss U Jars: enviar la jarra por mail */
/* Botón de enviar: el mismo círculo azul con el avión de papel del chat. */
.jar-send-open {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #1a73e8;
  color: #ffffff;
  cursor: pointer;
  touch-action: manipulation;
}

.jar-send-open.hidden {
  display: none;
}

.jar-send-open:hover:not(:disabled) {
  background: #1558b0;
}

.jar-send-open:disabled {
  opacity: 0.5;
  cursor: default;
}

.jar-game {
  position: relative;
}

/* El panel de envío tapa la jarra en vez de aparecer abajo. */
.jar-send {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
  overflow-y: auto;
}

.jar-send.hidden {
  display: none;
}

.jar-send-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #57606a;
}

/* Sin mensaje que escribir, la lista de amigos ocupa el resto del panel. */
.jar-send-friends {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border: 1px solid #e2e4e8;
  border-radius: 8px;
}

.jar-send-friends:empty {
  display: none;
}

.jar-send-friend {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  align-items: center;
  padding: 7px 10px;
  font-size: 14px;
  cursor: pointer;
}

.jar-send-friend + .jar-send-friend {
  border-top: 1px solid #f0f1f3;
}

.jar-send-friend:hover {
  background: #f1f3f6;
}

.jar-send-friend input {
  grid-row: span 2;
  accent-color: #1a73e8;
}

.jar-send-friend small {
  color: #8a919b;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jar-send .crop-modal-actions {
  justify-content: flex-end;
}

.jar-send-search {
  flex-shrink: 0;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d0d4da;
  border-radius: 14px;
  font: inherit;
  font-size: 14px;
}

.jar-send-search:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.jar-send-search.hidden,
.jar-send-friend.hidden {
  display: none;
}

.jar-send-empty {
  margin: 0;
  font-size: 13px;
  color: #8a919b;
  text-align: center;
}

/* Selector corazones / monedas */
.jar-mode {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #f1f3f6;
}

.jar-mode button {
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #57606a;
  cursor: pointer;
}

.jar-mode button:hover {
  color: #1f2328;
}

.jar-mode button[aria-pressed="true"] {
  background: #ffffff;
  color: #1a73e8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Wordle de las Escrituras (usa también las clases .sil-* de arriba) */
.wrd-game {
  gap: 6px;
}

.wrd-len {
  margin: 0;
  font-size: 13px;
  color: #57606a;
}

.wrd-loading {
  position: static;
  min-height: 120px;
}

.wrd-board {
  --len: 5;
  --gap: 5px;
  /* Casillas de hasta 48px, pero más chicas si la pantalla es baja: lo que
     sobra del alto (sin título, marcador, mensaje y teclado) se reparte
     entre las 6 filas. */
  --cell: clamp(20px, calc((var(--vv-height, 100vh) - 370px) / 6 - var(--gap)), 48px);
  display: grid;
  gap: var(--gap);
  width: min(100%, calc(var(--len) * var(--cell) + (var(--len) - 1) * var(--gap)));
}

.wrd-board.hidden {
  display: none;
}

.wrd-row {
  display: grid;
  grid-template-columns: repeat(var(--len), 1fr);
  gap: var(--gap);
}

.wrd-row.is-shake {
  animation: wrd-shake 0.35s ease;
}

.wrd-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #d7dae0;
  border-radius: 6px;
  background: #fff;
  font-size: clamp(12px, calc(var(--cell) * 0.5), 22px);
  font-weight: 700;
  color: #1f2328;
  text-transform: uppercase;
  user-select: none;
}

.wrd-cell.is-filled {
  border-color: #8b949e;
}

.wrd-cell.is-right,
.wrd-cell.is-near,
.wrd-cell.is-miss {
  color: #fff;
  animation: wrd-flip 0.4s ease both;
}

.wrd-cell.is-right {
  border-color: #1f9d55;
  background: #1f9d55;
}

.wrd-cell.is-near {
  border-color: #d4a017;
  background: #d4a017;
}

.wrd-cell.is-miss {
  border-color: #8b949e;
  background: #8b949e;
}

@keyframes wrd-flip {
  0% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}

@keyframes wrd-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.wrd-guide {
  font-size: 14px;
  font-weight: 600;
  color: #1a73e8;
  text-decoration: none;
}

.wrd-guide:hover {
  text-decoration: underline;
}

.wrd-keys {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(100%, 440px);
  margin-top: 4px;
}

.wrd-keys.hidden {
  display: none;
}

.wrd-key-row {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.wrd-key {
  flex: 1 1 0;
  min-width: 0;
  max-width: 40px;
  height: clamp(34px, 6vh, 44px);
  padding: 0;
  border: none;
  border-radius: 6px;
  background: #e4e7eb;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #1f2328;
  cursor: pointer;
  touch-action: manipulation;
}

.wrd-key.is-wide {
  flex: 1.6 1 0;
  max-width: 66px;
  font-size: 13px;
}

.wrd-key[data-key="⏎"] {
  background: #1f2328;
  color: #fff;
}

.wrd-key:hover {
  filter: brightness(0.95);
}

.wrd-key.is-right {
  background: #1f9d55;
  color: #fff;
}

.wrd-key.is-near {
  background: #d4a017;
  color: #fff;
}

.wrd-key.is-miss {
  background: #8b949e;
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .wrd-row.is-shake,
  .wrd-cell.is-right,
  .wrd-cell.is-near,
  .wrd-cell.is-miss {
    animation: none;
  }
}

/* Configuración → Idioma: tres botones, el actual queda marcado */
/* Seis idiomas: dos filas de tres, todos del mismo ancho */
.settings-lang {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.settings-lang-btn {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
  color: #1f2328;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.settings-lang-btn:hover {
  background: #f1f3f6;
}

.settings-lang-btn[aria-pressed="true"] {
  border-color: #1a73e8;
  background: #e8f0fe;
  color: #1a73e8;
  font-weight: 600;
}

.settings-lang-btn:disabled {
  cursor: wait;
}

/* Configuración → Estilos: subtítulos (Modo, Fondo del chat) y los dos
   botones de modo claro/oscuro. */
.settings-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #57606a;
}

.settings-subtitle .menu-icon {
  color: #1a73e8;
}

.settings-theme {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-theme .settings-lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Configuración → Fondo del chat: muestras para tocar, la elegida marcada */
.settings-wallpaper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
}

.settings-wallpaper-swatch {
  aspect-ratio: 3 / 4;
  min-height: 52px;
  padding: 0;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background-position: center;
  cursor: pointer;
}

.settings-wallpaper-swatch[aria-pressed="true"] {
  outline: 3px solid #1a73e8;
  outline-offset: 1px;
}

.settings-wallpaper-swatch:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 1px;
}

/* Colores del fondo (aparecen con Vitral, Aviones o Templo elegido) */
.wp-plane-colors {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 2px 0;
}

.wp-plane-color {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #d0d7de;
  cursor: pointer;
}

.wp-plane-color[aria-pressed="true"],
.wp-plane-color:focus-visible {
  box-shadow: 0 0 0 3px #1a73e8;
}

/* Vista previa del fondo: dos burbujas de mentira sobre el fondo probado. */
.wallpaper-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  padding: 12px 10px;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  background-position: center;
}

.wallpaper-preview-bubble {
  max-width: 75%;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: #1f2328;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.wallpaper-preview-bubble.is-in {
  align-self: flex-start;
  background: #fff;
}

.wallpaper-preview-bubble.is-out {
  align-self: flex-end;
  background: #d9fdd3;
}

/* Aparece al probar un fondo: no se guarda hasta tocar "Guardar". */
.wallpaper-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #e8f0fe;
  font-size: 13px;
}

.wallpaper-confirm.hidden {
  display: none;
}

.wallpaper-confirm span {
  flex: 1;
  color: #1f2328;
}

#chat-wallpaper-modal .crop-modal-content {
  align-items: stretch;
}

#chat-wallpaper-modal h3 {
  padding: 0 28px;
  text-align: center;
}

#chat-wallpaper-modal .settings-hint {
  margin: 0;
}

/* "General" (en el fondo de un chat): usa el fondo de Configuración. */
.settings-wallpaper-swatch.is-general {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  color: #1f2328;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  text-shadow: 0 0 3px #fff;
}

/* Muestra con un + para poner una foto propia de fondo */
.settings-wallpaper-swatch.wp-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #9aa4af;
  background: #f6f8fa;
  color: #5f6b77;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

.settings-wallpaper-swatch.wp-pick:hover {
  border-color: #1a73e8;
  color: #1a73e8;
}

.settings-wallpaper-swatch.wp-pick:disabled {
  opacity: 0.5;
  cursor: progress;
}

/* Selector de idioma chico de la pantalla de login */
.login-lang {
  margin-top: 8px;
  font-size: 13px;
  text-align: center;
}

.login-lang button {
  border: none;
  background: none;
  padding: 2px 4px;
  font: inherit;
  color: #57606a;
  cursor: pointer;
}

.login-lang button[aria-pressed="true"] {
  color: #1a73e8;
  font-weight: 600;
}

/* Íconos SVG que reemplazan a los emojis (ver icon() en app.js). Toman el
   tamaño del texto que los rodea. */
.icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  flex-shrink: 0;
}

[data-icon] {
  display: inline-flex;
  vertical-align: middle;
}

.icon-flame {
  color: #f4511e;
  fill: #ffb74d;
}

.icon-heart {
  color: #e91e63;
  fill: #f06292;
}

.icon-coin {
  color: #b8860b;
  fill: #f5c542;
}

.icon-trophy {
  color: #e0a100;
}

.icon-bulb {
  color: #e0a100;
}

.icon-hand {
  color: #e39b2e;
}

.icon-check {
  color: #188038;
}

/* Íconos al lado de cada opción (Configuración y menú ⋯ del chat). */
.menu-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: #6b7480;
}

.menu-icon .icon {
  width: 18px;
  height: 18px;
}

.settings-item,
.chat-menu-item,
.settings-section h4 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-section h4 .menu-icon {
  color: #1a73e8;
}

.settings-item-danger .menu-icon {
  color: inherit;
}

.settings-toggle .menu-icon {
  margin-right: 2px;
}

/* Tu misión en Mi perfil. */
.profile-mission {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-mission .friend-info-mission {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-mission-empty {
  color: #8a919b;
}

/* Editando el perfil: cada dato se vuelve un campo de texto. */
.profile-mission input {
  flex: 1 1 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d7dae0;
  border-radius: 6px;
  font: inherit;
}

.profile-mission .settings-hint {
  margin: 0;
}

/* El botón de editar (o Cancelar / Guardar), centrado abajo de los datos. */
#profile-actions {
  margin-top: 14px;
}

#profile-edit-status:not(.hidden) {
  margin-top: 10px;
}

/* --- Celular: barra de arriba y de abajo siempre quietas ---
   La página (html) no scrollea: el que scrollea es el body, que ocupa justo
   la pantalla. Así el navegador no esconde/muestra su barra de direcciones al
   scrollear (que era lo que hacía mover las barras), la de arriba queda
   pegada arriba y la de secciones queda fija abajo.
   overscroll-behavior: none (en los dos) saca el rebote elástico al llegar
   arriba o abajo de todo: con "contain" el navegador igual rebotaba y
   arrastraba las barras. Tirar para actualizar es propio (ver app.js) y no
   depende de ese rebote. */
@media (max-width: 640px) {
  html {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body {
    height: 100%;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
  }

  /* Con un modal abierto alcanza con frenar el scroll del body. */
  body.scroll-locked {
    position: static;
    top: auto !important;
    overflow: hidden;
  }
}

/* --- Lista de chats con el mismo diseño que el perfil de Amigos ---
   Cada chat es una tarjeta blanca con sombra suave, foto grande con aro
   blanco, y el chat abierto lleva la banda celeste. */

/* Las 4 secciones (Chats, Álbumes, Amigos con su perfil, y Mapa) no tienen
   panel de fondo: se ve el fondo de la página entero. Sin el panel, su
   relleno a los costados sobraba: las tarjetas usan todo el ancho, y
   arriba y abajo queda poco para que usen casi todo el alto. */
.panel[data-section] {
  background: transparent;
  border-color: transparent;
  padding: 6px 0;
}

.friend-summary-list li:not(.empty) {
  padding: 12px 14px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08);
  /* Poco espacio, pero el suficiente para que la tarjeta agrandada al pasar
     el cursor (scale 1.02, ~1px más por lado en alto) no toque a la vecina. */
  margin-bottom: 6px;
  transition: background 0.15s, box-shadow 0.15s;
}

.friend-summary-list li:not(.empty) .friend-summary-header {
  align-items: center;
  margin-bottom: 6px;
}

.friend-summary-list li:not(.empty) .friend-summary-identity {
  gap: 12px;
}

.friend-summary-list .friend-summary-avatar .friend-avatar {
  width: 42px;
  height: 42px;
  font-size: 17px;
  box-shadow: 0 0 0 3px #ffffff, 0 2px 8px rgba(31, 35, 40, 0.15);
  cursor: pointer;
  transition: transform 0.15s ease;
}

/* Pasar el cursor por la foto la agranda un poco: tocarla abre el perfil. */
.friend-summary-list .friend-summary-avatar .friend-avatar:hover {
  transform: scale(1.12);
}

.friend-summary-list .friend-summary-avatar .friend-avatar:active {
  transform: scale(1.04);
}

.friend-summary-list .email-unread {
  top: -7px;
  right: -8px;
}

.friend-summary-list .friend-summary-name {
  font-size: 15px;
  font-weight: 700;
  color: #1f2328;
}

/* Tarjeta compacta, como la de Amigos: la foto a la izquierda, ocupando
   todo el alto, y al lado el nombre con las filas del último mail recibido
   y del tuyo (con sus contadores) justo abajo. La cabecera y el bloque del
   nombre no arman caja propia (display: contents): la foto y el nombre van
   directo a la grilla. Igual en la tarjeta en espera (ver
   renderPendingSummaries), así al llegar los datos no salta. */
.friend-summary-list li:not(.empty):not(.skeleton-row) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  padding: 10px 14px;
}

.friend-summary-list li:not(.empty):not(.skeleton-row) .friend-summary-header,
.friend-summary-list li:not(.empty):not(.skeleton-row) .friend-summary-identity {
  display: contents;
}

/* La foto (con la campanita encima) es lo primero del bloque del nombre. */
.friend-summary-list li:not(.empty):not(.skeleton-row) .friend-summary-identity > :first-child {
  grid-column: 1;
  grid-row: 1 / span 3;
}

.friend-summary-list li:not(.empty):not(.skeleton-row) .friend-summary-name,
.friend-summary-list li:not(.empty):not(.skeleton-row) > :not(.friend-summary-header) {
  grid-column: 2;
  min-width: 0;
}

.friend-summary-list li:not(.empty):not(.skeleton-row) .friend-summary-name {
  grid-row: 1;
}

.friend-summary-list li.friend-summary-pending .skeleton-lines {
  margin-top: 6px;
}

.chat-enabled .friend-summary-list li:not(.empty):not(.skeleton-row):hover {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 8px rgba(31, 35, 40, 0.12);
}

/* Igual que los álbumes: pasar el cursor agranda un poco la tarjeta. Menos
   que un álbum porque la tarjeta ocupa todo el ancho de la lista. */
.chat-enabled .friend-summary-list li:not(.empty):not(.skeleton-row) {
  position: relative;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s ease;
}

.chat-enabled .friend-summary-list li:not(.empty):not(.skeleton-row):hover {
  z-index: 1;
  transform: scale(1.02);
}

.chat-enabled .friend-summary-list li:not(.empty):not(.skeleton-row):active {
  transform: scale(1.01);
}

/* Chats con correo sin leer: tarjeta azulada para diferenciarlos de los blancos. */
.friend-summary-list li:not(.empty):not(.skeleton-row):has(.email-unread) {
  background: rgba(198, 222, 250, 0.98);
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08), inset 0 0 0 1px rgba(110, 165, 240, 0.75);
}

.chat-enabled .friend-summary-list li:not(.empty):not(.skeleton-row):has(.email-unread):hover {
  background: rgba(184, 212, 248, 1);
  box-shadow: 0 2px 8px rgba(31, 35, 40, 0.12), inset 0 0 0 1px rgba(110, 165, 240, 0.85);
}

.chat-enabled .friend-summary-list li.chat-active:not(.empty):not(.skeleton-row),
.chat-enabled .friend-summary-list li.chat-active:not(.empty):not(.skeleton-row):hover {
  background: linear-gradient(160deg, rgba(207, 228, 247, 0.9), rgba(255, 255, 255, 0.85));
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08), inset 0 0 0 1px rgba(174, 203, 250, 0.7);
}

.friend-summary-list .skeleton-avatar {
  width: 42px;
  height: 42px;
}

/* --- Amigos, Álbumes y Mapa con el mismo diseño que la lista de chats ---
   Sin panel de fondo (ver .panel[data-section]), tarjetas blancas con sombra
   suave, fotos con aro blanco y la banda celeste en lo elegido. */

/* Amigos: cada amigo es una tarjeta con la foto grande y el nombre en negrita.
   Una debajo de la otra, ocupando todo el ancho: del mismo largo que las
   tarjetas de la lista de chats. */
.friends-by-mission ul {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* Separadas para que al agrandarse con el cursor no se toquen. */
  gap: 6px;
  margin-top: 8px;
  padding: 4px 0;
}

.friends-group-friend {
  gap: 12px;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08);
  font-size: 15px;
  font-weight: 700;
  color: #1f2328;
  position: relative;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s ease;
}

.friends-group-friend > span:not(.friends-group-extra) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friends-group-friend .friends-group-extra {
  margin-left: auto;
  font-weight: 600;
}

/* Orden "Por país": la misión va abajo del nombre, en chico. Las dos
   líneas se cortan con "…" si no entran. */
.friends-group-text > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friends-group-text .friends-group-sub {
  margin-top: 1px;
  font-size: 11px;
  font-weight: 600;
  color: #8a919b;
}

.friends-group-friend .friend-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  font-size: 17px;
  box-shadow: 0 0 0 3px #ffffff, 0 2px 8px rgba(31, 35, 40, 0.15);
}

.friends-group-friend:hover {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 8px rgba(31, 35, 40, 0.12);
}

/* Igual que la lista de chats: pasar el cursor agranda un poco la tarjeta
   (lo mismo que un chat, porque también ocupa todo el ancho). */
.friends-group-friend:hover {
  z-index: 1;
  transform: scale(1.02);
}

.friends-group-friend:active {
  transform: scale(1.01);
}

.friends-group-friend.friend-active,
.friends-group-friend.friend-active:hover {
  background: linear-gradient(160deg, rgba(207, 228, 247, 0.9), rgba(255, 255, 255, 0.85));
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08), inset 0 0 0 1px rgba(174, 203, 250, 0.7);
}

.friends-group-mission > a {
  display: inline-block;
  margin-top: 4px;
}

/* Álbumes: tarjetas blancas sin borde, con sombra suave y esquinas redondas. */
.album-card,
.album-card-skeleton {
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08);
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s ease;
}

a.album-card:hover {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 8px rgba(31, 35, 40, 0.12);
}

/* Igual que las fotos de los chats y del mapa: pasar el cursor agranda un
   poco la tarjeta (menos que una foto, para no tapar a las de al lado). */
a.album-card:hover {
  z-index: 1;
  transform: scale(1.05);
}

a.album-card:active {
  transform: scale(1.02);
}

/* Álbumes con cambios: tarjeta azulada para diferenciarlos de los blancos. */
.album-card:has(.album-changed) {
  background: rgba(198, 222, 250, 0.98);
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08), inset 0 0 0 1px rgba(110, 165, 240, 0.75);
}

a.album-card:has(.album-changed):hover {
  background: rgba(184, 212, 248, 1);
  box-shadow: 0 2px 8px rgba(31, 35, 40, 0.12), inset 0 0 0 1px rgba(110, 165, 240, 0.85);
}

.album-card .album-info,
.album-card-skeleton .album-info {
  padding: 10px 12px 12px;
}

.album-card .album-title,
.album-card-skeleton .album-title {
  font-size: 14px;
  font-weight: 700;
  color: #1f2328;
}

/* Mapa: marco redondeado con sombra, pines con aro blanco y popup como tarjeta. */
.friends-map {
  border: none;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08);
}

.friends-map-pin .friend-avatar {
  border: none;
  box-shadow: 0 0 0 3px #ffffff, 0 2px 8px rgba(31, 35, 40, 0.3);
}

.friends-map-pin:focus-visible .friend-avatar {
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px #1a73e8;
}

.friends-map-popup {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(31, 35, 40, 0.18);
}

/* --- Popups de perfil (amigo y Mi perfil) con el diseño del perfil de Amigos ---
   Siguen siendo popups, pero con la banda celeste arriba (foto grande con
   aro blanco, nombre en negrita) y los datos en una tarjeta blanca, una
   fila por dato. Solo aplica dentro de .crop-modal: el perfil puesto en el
   panel de PC tiene sus propios estilos (.friend-pane). */
.crop-modal .friend-info-modal-content {
  max-width: 440px;
  max-height: 88vh;
  padding: 16px;
  gap: 14px;
  align-items: stretch;
  border-radius: 18px;
  background: #f4f6f9;
  box-shadow: 0 10px 40px rgba(31, 35, 40, 0.25);
}

/* La barra de scroll de Mi perfil y del perfil de un amigo: fina y con
   margen arriba y abajo, para que no se salga de las esquinas redondeadas. */
.crop-modal .friend-info-modal-content::-webkit-scrollbar {
  width: 8px;
}

.crop-modal .friend-info-modal-content::-webkit-scrollbar-track {
  background: transparent;
  margin: 18px 0;
}

.crop-modal .friend-info-modal-content::-webkit-scrollbar-thumb {
  background: #dde1e6;
  border: none;
  border-radius: 999px;
}

.crop-modal .friend-info-modal-content::-webkit-scrollbar-thumb:hover {
  background: #c8cdd4;
}

@supports not selector(::-webkit-scrollbar) {
  .crop-modal .friend-info-modal-content {
    scrollbar-width: thin;
    scrollbar-color: #dde1e6 transparent;
  }
}

.crop-modal #friend-info-body,
.crop-modal #profile-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.crop-modal .friend-info-header {
  margin: 0;
  padding: 26px 18px 20px;
  gap: 8px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(207, 228, 247, 0.9), rgba(255, 255, 255, 0.85));
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08);
}

.crop-modal .friend-info-header .friend-avatar {
  width: 96px;
  height: 96px;
  font-size: 40px;
  box-shadow: 0 0 0 4px #ffffff, 0 4px 14px rgba(31, 35, 40, 0.15);
}

.crop-modal .friend-info-photo-btn {
  top: 0;
  right: -4px;
  width: 32px;
  height: 32px;
}

.crop-modal .friend-info-header h3 {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  color: #1f2328;
  text-align: center;
}

.crop-modal .friend-info-email,
.crop-modal .profile-username {
  font-size: 13px;
}

/* Datos: una fila por dato, la etiqueta a la izquierda y el valor a la derecha. */
.crop-modal .friend-info-details {
  display: grid;
  grid-template-columns: minmax(96px, 128px) 1fr;
  font-size: 14px;
  line-height: 1.45;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08);
  overflow: hidden;
}

.crop-modal .friend-info-details dt,
.crop-modal .friend-info-details dd {
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid #edf0f3;
}

.crop-modal .friend-info-details dt:first-of-type,
.crop-modal .friend-info-details dt:first-of-type + dd {
  border-top: none;
}

.crop-modal .friend-info-details dt {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7480;
}

.crop-modal .friend-info-details dd {
  color: #1f2328;
}

.crop-modal .friend-info-details .email-date {
  margin-top: 2px;
  font-size: 12px;
  color: #6b7480;
}

.crop-modal .mission-flags img {
  height: 14px;
}

.crop-modal .friend-info-albums {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}

.crop-modal .friend-info-albums a {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e8f0fe;
}

.crop-modal .friend-info-modal-content .crop-modal-actions {
  justify-content: center;
}

.crop-modal .friend-info-modal-content .modal-close-x {
  top: 22px;
  right: 22px;
  z-index: 1;
}

.crop-modal .profile-note {
  margin: 0;
}

/* En celular angosto: la etiqueta arriba y el valor abajo. */
@media (max-width: 400px) {
  .crop-modal .friend-info-details {
    grid-template-columns: 1fr;
  }

  .crop-modal .friend-info-details dd {
    padding-top: 0;
    border-top: none;
  }
}

/* Recargar en la app instalada (PWA): indicador del gesto de deslizar
   hacia abajo y giro del botón ↻ (ver pwa.js). */
.ptr-indicator {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  z-index: 10000;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  color: #57606a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translate(-50%, -50px);
  pointer-events: none;
}

.ptr-indicator.ready {
  color: #1a73e8;
}

.ptr-indicator.loading svg,
.ptr-spin {
  animation: ptr-spin 0.8s linear infinite;
}

@keyframes ptr-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- Celular --- */
@media (max-width: 640px) {
  /* Fotos, álbumes y videos del chat del ancho que entra en la burbuja.
     Burbuja = 80% de la lista; la lista = pantalla - 24px de la grilla
     - 16px del panel del chat - 8px de la lista; menos 20px de padding de la
     burbuja => 80vw - 59px (se redondea a 60). Sin esto, en celulares
     angostos la foto se salía del globo. */
  .chat-photo,
  .chat-album {
    width: min(240px, calc(80vw - 60px));
  }

  .chat-photo {
    height: min(240px, calc(80vw - 60px));
  }

  .chat-video {
    width: min(260px, calc(80vw - 60px));
  }

  .chat-album .chat-video {
    width: 56%;
  }

  .chat-photo.chat-photo-jar {
    width: min(145px, calc(80vw - 60px));
    height: auto;
  }
}

/* En celular (pantalla chica o táctil) sin barra de scroll visible:
   se sigue pudiendo deslizar, solo no se dibuja la barra. */
@media (max-width: 640px), (pointer: coarse) {
  *,
  .settings-modal-content {
    scrollbar-width: none;
  }

  ::-webkit-scrollbar,
  .settings-modal-content::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}

/* Botón ← del chat: solo en pantallas angostas (ver abajo). */
.chat-back-btn {
  display: none;
}

/* --- Celular y pantallas angostas: el chat no es popup, tapa la lista ---
   Al abrir un chat (body.chat-open) se esconde el bloque de la lista y en su
   lugar se muestra #chat-pane, que llena la pantalla entre la barra de
   arriba y la de abajo. La ← (o ⋮ → Cerrar chat) vuelve a la lista. */
@media (max-width: 900px) {
  /* Mide solo la parte visible (--vv-height / --vv-top, ver app.js): en
     iPhone el teclado no achica la página y la caja de escribir quedaba
     detrás. Fijo arriba de lo visible para que Safari no la corra. */
  body.chat-open[data-view="gmail"] {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--vv-top, 0px);
    height: 100vh;
    height: 100dvh;
    height: var(--vv-height, 100dvh);
    overflow: hidden;
  }

  body.chat-open[data-view="gmail"] > * {
    flex-shrink: 0;
  }

  /* El chat abierto llena la pantalla de borde a borde: sin el margen de
     la grilla, sin el borde/redondeo del panel y sin las barras (ni la
     barra lateral de las tablets). */
  body.chat-open[data-view="gmail"] {
    padding-left: 0;
  }

  body.chat-open[data-view="gmail"] .topbar,
  body.chat-open[data-view="gmail"] .view-nav {
    display: none;
  }

  body.chat-open[data-view="gmail"] .grid-layout {
    flex: 1 1 0;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
    padding: 0;
    gap: 0;
  }

  body.chat-open[data-view="gmail"] [data-section="gmail"]:not(.chat-pane) {
    display: none;
  }

  /* El + de "Agregar amigo" taparía el micrófono y el campo de texto. */
  body.chat-open[data-view="gmail"] .fab {
    display: none;
  }

  body.chat-open[data-view="gmail"] .chat-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: calc(10px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right))
      calc(10px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
    border: none;
    border-radius: 0;
  }

  .chat-pane-empty {
    display: none;
  }

  /* El fondo del chat va de borde a borde: la conversación se sale del
     padding lateral del panel. Los mensajes respetan el notch/bordes curvos. */
  body.chat-open[data-view="gmail"] .chat-pane .chat-list-wrap {
    margin-left: calc(-8px - env(safe-area-inset-left));
    margin-right: calc(-8px - env(safe-area-inset-right));
  }

  /* El fondo va en una capa detrás de la lista que no se achica con el
     teclado: mide lo que la lista + lo que tapa el teclado (--kb-height,
     ver app.js). Así el dibujo queda quieto y el teclado lo tapa, en vez de
     reacomodarse a la lista más chica. */
  body.chat-open[data-view="gmail"] .chat-pane .chat-list-wrap {
    overflow: hidden;
    isolation: isolate;
  }

  body.chat-open[data-view="gmail"] .chat-pane .chat-list-wrap::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: calc(100% + var(--kb-height, 0px));
    z-index: -1;
    background: var(--chat-bg, #d6e8f7);
    pointer-events: none;
  }

  html[data-theme="dark"] body.chat-open[data-view="gmail"] .chat-pane .chat-list-wrap::before {
    background: var(--chat-bg, #1d374d);
  }

  body.chat-open[data-view="gmail"] .chat-pane .chat-list {
    background: transparent;
    border-radius: 0;
    padding-left: calc(4px + env(safe-area-inset-left));
    padding-right: calc(4px + env(safe-area-inset-right));
  }

  .chat-pane .chat-modal-content {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    height: auto;
    padding: 0;
    background: transparent;
    gap: 10px;
  }

  .chat-pane .chat-modal-content h3 {
    padding: 0 44px;
    min-height: 34px;
  }

  .chat-back-btn {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #24292f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }

  .chat-back-btn:active {
    background: #f0f2f5;
  }

  /* En el teléfono ya está la flecha ←: sobra "Cerrar chat" en el menú. */
  #chat-close {
    display: none;
  }

  .chat-pane .chat-modal-content .chat-menu-btn {
    top: 2px;
    right: 0;
  }

  .chat-pane .chat-modal-content .chat-menu {
    top: 36px;
    right: 0;
  }
}

/* --- Tirar para abajo para actualizar (celular, ver app.js) --- */
.pull-refresh {
  position: fixed;
  left: 50%;
  z-index: 39; /* debajo de la barra de arriba: sale desde atrás de ella */
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  color: #8a919b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translate(-50%, -44px);
  pointer-events: none;
}

.pull-refresh svg {
  width: 22px;
  height: 22px;
}

.pull-refresh.is-ready,
.pull-refresh.is-loading {
  color: #1a73e8;
}

.pull-refresh.is-loading svg {
  animation: refresh-spin 0.8s linear infinite;
}

@media (min-width: 641px) {
  .pull-refresh {
    display: none;
  }
}

/* Cartel de micrófono bloqueado en el chat: botones y pasos. */
.mic-denied-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.mic-denied-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.mic-denied-steps {
  margin: 10px 0 0;
  padding-left: 20px;
  line-height: 1.45;
}

.mic-denied-steps li + li {
  margin-top: 6px;
}

/* Menú de los cuadros de texto (text-format.js): copiar, cortar, pegar,
   seleccionar todo y "Txt", que despliega las opciones de formato. Con el
   mouse sale donde se hizo click derecho; con el dedo, como barra arriba
   del cuadro. */
.text-format {
  position: fixed;
  z-index: 10002;
  display: flex;
  flex-direction: column;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.text-format.hidden,
.text-format-sub.hidden {
  display: none;
}

.text-format-main,
.text-format-sub {
  display: flex;
}

.text-format-sub {
  border-top: 1px solid #e3e7ec;
}

.text-format-menu {
  min-width: 210px;
  padding: 6px 0;
}

.text-format-menu .text-format-main,
.text-format-menu .text-format-sub {
  flex-direction: column;
}

.text-format-menu .text-format-sub {
  margin-top: 4px;
  padding-top: 4px;
  background: #fafbfc;
}

.text-format-bar {
  padding: 4px;
  max-width: calc(100vw - 16px);
}

.text-format-bar .text-format-main,
.text-format-bar .text-format-sub {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 2px;
}

.text-format-bar .text-format-sub {
  margin-top: 4px;
  padding-top: 4px;
}

.text-format-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  color: #1f2328;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.text-format-item:disabled {
  opacity: 0.4;
  cursor: default;
}

.text-format-menu .text-format-item {
  width: 100%;
  padding: 9px 14px;
}

.text-format-bar .text-format-item {
  justify-content: center;
  min-width: 42px;
  height: 40px;
  padding: 0 8px;
  border-radius: 8px;
}

.text-format-bar .text-format-label,
.text-format-bar .text-format-caret {
  display: none;
}

.text-format-item:not(:disabled):hover,
.text-format-item:focus-visible,
.text-format-item:not(:disabled):active,
.text-format-open .text-format-txt {
  background: #f1f3f6;
  outline: none;
}

.text-format-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  color: #6b7480;
}

.text-format-glyph .ico,
.text-format-caret .ico {
  display: block;
}

.text-format-bar .text-format-glyph {
  color: #1f2328;
}

.text-format-bar .text-format-glyph .ico {
  width: 20px;
  height: 20px;
}

.text-format-caret {
  display: inline-flex;
  margin-left: auto;
  color: #6b7480;
  transition: transform 0.15s;
}

.text-format-open .text-format-caret {
  transform: rotate(90deg);
}

/* ============================================================
   Administrar cuentas (/admin)
   Contenido centrado, pestañas arriba (una sección a la vez) y cada
   fila con la misma estructura: inicial, nombre + etiquetas, datos y
   acciones a la derecha.
   ============================================================ */

/* También se usa en el perfil (app.js), al lado del nombre. */
.admin-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  color: #1558b0;
  background: #eef4fd;
  border-radius: 999px;
  padding: 1px 8px;
  vertical-align: middle;
}

.admin-badge.is-admin { color: #6b3fa0; background: #f3ecfb; }
.admin-badge.is-pending { color: #8a5a00; background: #fff4d6; }
.admin-badge.is-approved,
.admin-badge.is-resolved { color: #1a7f37; background: #e6f6ea; }
.admin-badge.is-rejected,
.admin-badge.is-bug { color: #a8271f; background: #fdecea; }
.admin-badge.is-cancelled,
.admin-badge.is-other { color: #57606a; background: #eef0f2; }
.admin-badge.is-open { color: #8a5a00; background: #fff4d6; }

.admin-back-link {
  display: inline-block;
  background: #eef0f2;
  color: #1f2328;
  text-decoration: none;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 8px;
}

.admin-back-link:hover {
  background: #e2e4e8;
}

/* En /admin la barra de arriba es horizontal también en PC (la regla general
   de min-width: 641px la vuelve una columna fija a la izquierda). El título y
   el botón Volver quedan alineados con el contenido centrado (.admin-page). */
.admin-body .topbar,
.admin-body .topbar h1 {
  pointer-events: auto;
}

.admin-body .topbar {
  position: sticky;
  top: 0;
  bottom: auto;
  z-index: 20;
  width: auto;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px max(24px, calc((100% - 920px) / 2 + 24px));
  background: #ffffff;
  border-bottom: 1px solid #e2e4e8;
}

.admin-body .topbar h1 {
  font-size: 20px;
}

@media (max-width: 640px) {
  .admin-body .topbar {
    padding: 12px 16px;
  }

  .admin-body .topbar h1 {
    font-size: 17px;
  }
}

/* Aviso flotante arriba al centro, encima de todo. */
.admin-page-status {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0;
  box-shadow: 0 4px 16px rgba(31, 35, 40, 0.12);
}

.admin-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

/* --- Pestañas --- */
.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  background: #eaecef;
  border-radius: 10px;
}

.admin-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #57606a;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.admin-tab:hover {
  color: #1f2328;
}

.admin-tab.active {
  background: #ffffff;
  color: #1f2328;
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.1);
}

.admin-tab-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #1a73e8;
  color: #ffffff;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}

.admin-tab-count.hidden {
  display: none;
}

/* --- Sección --- */
.admin-panel {
  padding: 20px;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-section-header h2 {
  margin: 0;
}

.admin-search,
.admin-select {
  padding: 7px 10px;
  border: 1px solid #d7dae0;
  border-radius: 8px;
  font-size: 13px;
  background: #ffffff;
  color: #1f2328;
}

.admin-search {
  width: 220px;
  border-radius: 14px;
}

.admin-search:focus,
.admin-select:focus,
.admin-reset-form input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-empty {
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  color: #8a919b;
}

/* --- Filas --- */
.admin-row {
  border: 1px solid #eef0f2;
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.15s;
}

.admin-row:hover {
  border-color: #d7dae0;
}

.admin-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8eef7;
  color: #1558b0;
  font-weight: 700;
  font-size: 14px;
}

.admin-row-info {
  flex: 1;
  min-width: 0;
}

.admin-row-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-row-title .admin-badge {
  margin-left: 0;
}

.admin-username {
  font-weight: 600;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.admin-row-subject {
  margin-top: 2px;
  font-size: 14px;
}

.admin-meta {
  margin-top: 2px;
  font-size: 12px;
  color: #57606a;
}

.admin-user-agent {
  margin-top: 8px;
  color: #8a919b;
  overflow-wrap: anywhere;
}

.admin-note {
  margin: 10px 0 0 46px;
  padding: 10px 12px;
  background: #f5f6f8;
  border-radius: 8px;
  font-size: 13px;
  color: #1f2328;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-row .admin-user-agent {
  margin-left: 46px;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* --- Botones --- */
.admin-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: #1a73e8;
  color: #ffffff;
  white-space: nowrap;
}

.admin-btn:hover {
  background: #1558b0;
}

.admin-btn.secondary {
  background: #eef0f2;
  color: #1f2328;
}

.admin-btn.secondary:hover,
.admin-btn.secondary.active {
  background: #e2e4e8;
}

.admin-btn.danger {
  background: #fdecea;
  color: #a8271f;
}

.admin-btn.danger:hover {
  background: #f9d6d2;
}

.admin-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* --- Restablecer contraseña --- */
.admin-reset-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
  margin: 12px 0 0 46px;
}

.admin-reset-form.hidden {
  display: none;
}

.admin-reset-form input {
  padding: 8px 10px;
  border: 1px solid #d7dae0;
  border-radius: 8px;
  font-size: 13px;
}

.admin-reset-form .status {
  margin: 0;
}

.admin-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* --- Celular: controles abajo del nombre, a todo el ancho --- */
@media (max-width: 640px) {
  .admin-page {
    padding: 12px 12px 32px;
  }

  .admin-page-status {
    top: 64px;
  }

  .admin-tab {
    padding: 8px 6px;
    font-size: 13px;
  }

  .admin-panel {
    padding: 14px;
  }

  .admin-section-header {
    flex-wrap: wrap;
  }

  .admin-search {
    width: 100%;
  }

  .admin-row-main {
    flex-wrap: wrap;
  }

  .admin-row-info {
    flex-basis: calc(100% - 46px);
  }

  .admin-row-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-row-actions > * {
    flex: 1 1 140px;
  }

  .admin-tier-select {
    min-width: 0;
    padding: 9px 8px;
  }

  .admin-btn {
    padding: 9px 12px;
  }

  .admin-note,
  .admin-row .admin-user-agent,
  .admin-reset-form {
    margin-left: 0;
  }

  .admin-reset-form {
    max-width: none;
  }

  /* 16px evita que iOS haga zoom al tocar el campo */
  .admin-reset-form input,
  .admin-search,
  .admin-select {
    font-size: 16px;
  }
}

/* ============================================================
   /admin#trafico: tráfico del servidor (admins y soporte)
   Los gráficos son SVG armados en admin.js; los colores van acá
   porque la CSP no permite style="" inline.
   ============================================================ */

.admin-badge.is-support { color: #0b6e74; background: #e3f5f6; }

.traffic-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.traffic-header-actions .admin-meta {
  margin: 0;
}

.traffic-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.traffic-kpi {
  border: 1px solid #eef0f2;
  border-radius: 10px;
  padding: 10px 12px;
}

.traffic-kpi-value {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1f2328;
}

.traffic-kpi-label {
  margin-top: 2px;
  font-size: 12px;
  color: #57606a;
}

.traffic-kpi.is-warn { border-color: #f0d48a; background: #fffaeb; }
.traffic-kpi.is-warn .traffic-kpi-value { color: #8a5a00; }
.traffic-kpi.is-bad { border-color: #f3b8b2; background: #fdf3f2; }
.traffic-kpi.is-bad .traffic-kpi-value { color: #a8271f; }

.traffic-block {
  margin-top: 20px;
  min-width: 0;
}

.traffic-block h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.traffic-block h3 .admin-meta {
  display: inline;
  font-weight: 400;
}

.traffic-block .admin-section-header {
  margin-bottom: 8px;
}

.traffic-block .admin-section-header h3 {
  margin: 0;
}

.traffic-chart {
  position: relative;
  border: 1px solid #eef0f2;
  border-radius: 10px;
  padding: 18px 8px 8px;
}

.traffic-chart svg {
  display: block;
  width: 100%;
  height: 120px;
}

.traffic-chart-max {
  position: absolute;
  top: 2px;
  left: 10px;
  margin: 0;
}

.traffic-bar-bg { fill: transparent; }
.traffic-chart g:hover .traffic-bar-bg { fill: #f2f4f7; }
.traffic-bar { fill: #1a73e8; }
.traffic-bar-err { fill: #d93025; }

.traffic-block-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.traffic-block-form .admin-search {
  flex: 1 1 160px;
  width: auto;
}

.traffic-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.traffic-columns .traffic-block {
  margin-top: 20px;
}

.traffic-top {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.traffic-top-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.traffic-top-key {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.traffic-top-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.traffic-top-bar {
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 2px;
  border: none;
  border-radius: 2px;
  appearance: none;
  background: #eef0f2;
  overflow: hidden;
}

.traffic-top-bar::-webkit-progress-bar { background: #eef0f2; }
.traffic-top-bar::-webkit-progress-value { background: #1a73e8; }
.traffic-top-bar::-moz-progress-bar { background: #1a73e8; }

.traffic-mini-btn {
  padding: 2px 8px;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  background: #fdecea;
  color: #a8271f;
}

.traffic-mini-btn:hover {
  background: #f9d6d2;
}

.traffic-table-wrap {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #eef0f2;
  border-radius: 10px;
}

.traffic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.traffic-table th,
.traffic-table td {
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid #f2f4f7;
}

.traffic-table th {
  position: sticky;
  top: 0;
  background: #f5f6f8;
  font-weight: 600;
  color: #57606a;
}

.traffic-path {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.traffic-status {
  font-weight: 600;
  color: #1a7f37;
}

.traffic-status.is-4xx { color: #8a5a00; }
.traffic-status.is-429 { color: #b35900; }
.traffic-status.is-5xx { color: #a8271f; }
.traffic-slow { color: #a8271f; font-weight: 600; }

@media (max-width: 640px) {
  .traffic-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .traffic-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .traffic-block-form > * {
    flex: 1 1 100%;
  }

  .traffic-block-form .admin-search,
  .traffic-block-form .admin-select {
    font-size: 16px;
  }
}

/* Configuración → Administración: lo que soporte no ve (ver loadSession). */
.settings-toggle.hidden,
.settings-hint.hidden {
  display: none;
}

/* --- Configuración con el mismo aspecto que Mi perfil ---
   Fondo gris azulado, cada sección en su tarjeta blanca redondeada con
   sombra suave, y el ícono de cada sección en un círculo celeste. */
#settings-modal .settings-modal-content {
  width: min(400px, calc(100% - 24px));
  padding: 16px;
  gap: 10px;
  border-radius: 18px;
  background: #f4f6f9;
  box-shadow: 0 10px 40px rgba(31, 35, 40, 0.25);
}

#settings-modal .settings-modal-content::-webkit-scrollbar-track {
  margin: 18px 0;
}

#settings-modal .settings-modal-content > h3 {
  margin: 4px 0 4px 4px;
  font-size: 20px;
  font-weight: 700;
  color: #1f2328;
  text-align: left;
}

#settings-modal .settings-section {
  padding: 12px 14px;
  border: none;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08);
  transition: box-shadow 0.15s;
}

#settings-modal .settings-section + .settings-section {
  padding-top: 12px;
  border-top: none;
}

#settings-modal .settings-collapsible:not([open]):hover {
  box-shadow: 0 2px 8px rgba(31, 35, 40, 0.12);
}

#settings-modal .settings-collapsible > summary {
  padding: 0;
}

#settings-modal .settings-collapsible[open] > summary {
  margin-bottom: 12px;
}

#settings-modal .settings-section h4 {
  font-size: 15px;
  font-weight: 600;
}

#settings-modal .settings-section h4 .menu-icon {
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f0fe;
  color: #1a73e8;
}

#settings-modal .settings-toggle {
  border-top-color: #edf0f3;
}

#settings-modal .settings-toggle + .settings-hint {
  border-top-color: #edf0f3;
}

#settings-modal .settings-list {
  margin: 0 -8px;
}

#settings-modal .settings-item {
  padding: 10px 8px;
  border-radius: 10px;
}

#settings-modal .settings-item:hover {
  background: #f4f6f9;
}

#settings-modal .settings-item-danger:hover {
  background: #fdecea;
}

#settings-modal .settings-lang-btn {
  border-radius: 10px;
}

#settings-modal .settings-version {
  margin: 4px 0 0;
}

/* Color de mi burbuja (Configuración → Estilos; no en el plan Free).
   app.js pone data-bubble-color en <html>; las muestras usan el mismo
   atributo para verse con su color. Los tonos oscuros están en dark.css. */
[data-bubble-color="default"] { --my-bubble: #d2e3fc; }
[data-bubble-color="green"] { --my-bubble: #d9fdd3; }
[data-bubble-color="teal"] { --my-bubble: #c8f1ee; }
[data-bubble-color="purple"] { --my-bubble: #e6dcfb; }
[data-bubble-color="pink"] { --my-bubble: #fbdcec; }
[data-bubble-color="red"] { --my-bubble: #fddad7; }
[data-bubble-color="orange"] { --my-bubble: #fee4c8; }
[data-bubble-color="yellow"] { --my-bubble: #fdf3c2; }
[data-bubble-color="gray"] { --my-bubble: #e4e6e9; }

/* Con "default" se deja el color de siempre (y el de la vista previa del
   fondo, que es otro). */
html[data-bubble-color]:not([data-bubble-color="default"]) .chat-sent,
html[data-bubble-color]:not([data-bubble-color="default"]) .wallpaper-preview-bubble.is-out {
  background: var(--my-bubble);
}

.bubble-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 12px;
}

.bubble-color-swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #d0d7de;
  border-radius: 50%;
  background: var(--my-bubble);
  cursor: pointer;
}

.bubble-color-swatch[aria-pressed="true"],
.bubble-color-swatch:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 1px;
}

.bubble-color-swatches.is-locked .bubble-color-swatch {
  opacity: 0.45;
  cursor: not-allowed;
}

.bubble-color-swatches.is-locked .bubble-color-swatch[aria-pressed="true"] {
  outline: none;
}

#settings-bubble-color-locked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#settings-bubble-color-locked.hidden {
  display: none;
}

.bubble-color-plans {
  padding: 4px 10px;
  font-size: 13px;
}

/* Color de fondo de la página y del logo (Configuración → Estilos; no en
   el plan Free). app.js pone data-page-bg y data-logo-color en <html>; las
   muestras usan el mismo atributo. Los tonos de fondo oscuros están en
   scripts/dark_overrides.css; los del logo sirven para los dos modos. */
[data-page-bg="default"] { --page-bg: #f5f6f8; }
[data-page-bg="blue"] { --page-bg: #e6eefc; }
[data-page-bg="green"] { --page-bg: #e5f3e8; }
[data-page-bg="teal"] { --page-bg: #dff2f0; }
[data-page-bg="purple"] { --page-bg: #eee8fa; }
[data-page-bg="pink"] { --page-bg: #fbe7f0; }
[data-page-bg="orange"] { --page-bg: #fdeedd; }
[data-page-bg="yellow"] { --page-bg: #fbf5dc; }
[data-page-bg="gray"] { --page-bg: #e9ebee; }

html[data-page-bg]:not([data-page-bg="default"]) body {
  background: var(--page-bg);
}

[data-logo-color="default"] { --logo-color: #4aa8e0; }
[data-logo-color="green"] { --logo-color: #34a853; }
[data-logo-color="teal"] { --logo-color: #14a394; }
[data-logo-color="purple"] { --logo-color: #8e5cf0; }
[data-logo-color="pink"] { --logo-color: #e0559a; }
[data-logo-color="red"] { --logo-color: #e5483d; }
[data-logo-color="orange"] { --logo-color: #f08c2e; }
[data-logo-color="yellow"] { --logo-color: #e8b400; }
[data-logo-color="gray"] { --logo-color: #7d8590; }

/* Logo de la app (index.html): el SVG de una sola tinta se usa de máscara,
   así toma el color elegido. */
.brand-logo-tint {
  display: inline-block;
  background: var(--logo-color, #4aa8e0);
  -webkit-mask: url("favicon.svg") center / contain no-repeat;
  mask: url("favicon.svg") center / contain no-repeat;
}

.page-bg-swatch {
  background: var(--page-bg);
}

.logo-color-swatch {
  background: var(--logo-color);
}

/* --- PIN al entrar (ver pin-lock.js) --- */
/* Tapa toda la app, opaca, por encima de cualquier modal. Con .is-cover
   (arrancando o en segundo plano) se ve solo el fondo, sin el formulario. */
.pin-lock {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #f5f6f8;
}

.pin-lock.hidden {
  display: none;
}

.pin-lock.is-cover .pin-lock-card {
  visibility: hidden;
}

html.pin-locked body {
  overflow: hidden;
}

.pin-lock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 300px;
  padding: 28px 24px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.pin-lock-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.pin-lock-card h3 {
  margin: 0;
  font-size: 18px;
  color: #1f2328;
}

.pin-lock-card input,
.pin-settings-form input {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2328;
  font-size: 16px;
}

.pin-lock-card input {
  max-width: 200px;
  text-align: center;
  font-size: 24px;
  letter-spacing: 8px;
}

.pin-lock-error {
  min-height: 18px;
  margin: 0;
  font-size: 13px;
  color: #a8271f;
  text-align: center;
}

#pin-lock-submit {
  width: 100%;
  max-width: 200px;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #1a73e8;
  color: #ffffff;
  font-size: 15px;
  cursor: pointer;
}

#pin-lock-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.pin-lock-forgot {
  border: none;
  background: transparent;
  color: #57606a;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.pin-settings-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 10px;
}

.pin-settings-form.hidden,
.pin-settings-form .hidden,
.pin-settings-change.hidden,
#settings-pin-locked.hidden {
  display: none;
}

.pin-settings-form .settings-hint {
  margin: 0;
  color: #a8271f;
}

.pin-settings-form .crop-modal-actions {
  justify-content: flex-end;
}

.pin-settings-change {
  margin: 0 0 10px;
  padding: 6px 12px;
  font-size: 13px;
}

/* Aviso "No disponible en el plan Free" de los links de Drive (amigo y Mi
   perfil): mismo diseño que el del color de burbuja. */
.plan-locked-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.plan-locked-hint.hidden {
  display: none;
}

/* Round checkboxes (global) */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 2px solid #9aa0a6;
  border-radius: 50%;
  background: #fff center / 12px 12px no-repeat;
  cursor: pointer;
  vertical-align: middle;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

input[type="checkbox"]:hover:not(:disabled) {
  border-color: #1a73e8;
}

input[type="checkbox"]:checked {
  border-color: #1a73e8;
  background-color: #1a73e8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 12.5 10 17.5 19 7'/%3E%3C/svg%3E");
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Barras de búsqueda: una lupa a la izquierda en vez del texto de ayuda
   (el aria-label sigue diciendo qué busca cada una). Con "html" adelante
   para ganarle al "background" de los temas, que borraría la imagen. */
html input[type="search"].chat-search,
html input[type="search"].jar-send-search,
html input[type="search"].admin-search {
  padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a919b' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 20 20'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px center;
  background-size: 16px 16px;
}

/* Tutorial de bienvenida (ver "tutorial" en app.js). La pantalla se oscurece
   con la sombra enorme del hueco, que deja ver solo lo que se explica. El
   contenedor tapa toda la app para que no se toque nada por detrás. */
.tour {
  position: fixed;
  inset: 0;
  z-index: 10050;
}

.tour-hole {
  position: fixed;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.58);
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 0;
  pointer-events: none;
  transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
}

.tour-card {
  position: fixed;
  box-sizing: border-box;
  width: min(320px, calc(100vw - 32px));
  padding: 16px 16px 12px;
  border-radius: 14px;
  background: #ffffff;
  color: #1f2328;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: top 0.25s ease, left 0.25s ease;
  animation: tour-in 0.2s ease;
}

@keyframes tour-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.tour-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.tour-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #57606a;
}

.tour-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.tour-dots {
  display: flex;
  gap: 4px;
  margin-right: auto;
}

.tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d0d4d9;
  transition: width 0.2s ease, background 0.2s ease;
}

.tour-dot.is-active {
  width: 16px;
  border-radius: 3px;
  background: #1a73e8;
}

.tour-actions button {
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.tour-skip,
.tour-back {
  background: transparent;
  color: #57606a;
}

.tour-skip:hover,
.tour-back:hover {
  background: #eef0f3;
}

.tour-next {
  background: #1a73e8;
  color: #ffffff;
  font-weight: 600;
}

.tour-next:hover {
  background: #1558b0;
}

@media (prefers-reduced-motion: reduce) {
  .tour-hole,
  .tour-card,
  .tour-dot {
    transition: none;
    animation: none;
  }
}
