/* Vozcanal · diseño E "Simple, como WhatsApp"
   Tema oscuro, dos tonos, acento verde. Todo en un solo archivo, sin CDN. */

:root {
  --bg: #0d131f;
  --panel: #151e2d;
  --panel2: #0f1724;
  --linea: #22304d;
  --texto: #e8eefc;
  --muted: #a8b8cf;
  --verde: #25d366;
  --marca: #25d366;   /* el color del negocio en uso */
  --verde-salida: #1f6b4a;
  --burbuja-entra: #1d2a3d;
  --linea-fuerte: #4b6ba6;   /* borde de los campos: que se vea, no que se adivine */
  --t-base: 16px;
  --t-nombre: 17px;
  --t-titulo: 22px;
  --t-grande: 25px;
  color-scheme: dark;
}

body.texto-grande {
  --t-base: 19px;
  --t-nombre: 20px;
  --t-titulo: 24px;
  --t-grande: 25px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--texto);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: var(--t-base);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  overflow-wrap: break-word;
}

.oculto {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.app { min-height: 100vh; }

body.en-conversacion { overflow: hidden; }

.vistas { padding: 4px 0 132px; }

.pantalla { display: block; }

/* ---------- Barra superior ---------- */
.barra {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--linea);
}

.barra-negocio { flex-direction: column; gap: 2px; background: var(--panel); }
.barra-linea { font-size: 14px; color: var(--verde); font-weight: 600; }
.barra-linea.muted { color: var(--muted); }

.marca-bola {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--verde);
  color: #06281a;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.barra-textos { min-width: 0; flex: 1 1 auto; }
.barra-titulo {
  margin: 0;
  font-size: var(--t-nombre);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.barra-sub {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boton-volver {
  flex: 0 0 auto;
  width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--linea-fuerte);
  background: var(--panel2);
  color: #ffffff;
  cursor: pointer;
}
.boton-volver svg { width: 34px; height: 34px; }
.boton-volver:active { background: var(--panel); border-color: var(--verde); }

/* ---------- Banda de conexión ---------- */
.banda {
  margin: 0;
  padding: 12px 14px;
  background: #3a2410;
  border-bottom: 1px solid #6b4a1f;
  color: #ffd9a8;
  font-size: var(--t-base);
  font-weight: 600;
  text-align: center;
}

/* ---------- Buscador ---------- */
.buscador { padding: 10px 10px 6px; }

.campo {
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: var(--t-base);
  color: var(--texto);
  background: var(--panel2);
  border: 2px solid var(--linea-fuerte);
  border-radius: 14px;
  outline-offset: 2px;
}
.campo:focus {
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.28);
}
.campo::placeholder { color: var(--muted); opacity: 1; }
.campo-buscar { border-radius: 24px; padding-left: 10px; padding-right: 10px; }
/* El texto del buscador es largo y va fijo: no se agranda con "Texto más grande"
   para que "Buscar o empezar una conversación" siempre se lea completo. */
.texto-grande .campo-buscar { font-size: 17px; }

/* ---------- Listas y filas ---------- */
.lista { display: block; }

.seccion-titulo {
  margin: 16px 14px 8px;
  font-size: var(--t-nombre);
  font-weight: 800;
  color: var(--texto);
}

.fila {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--linea);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.fila:active { background: var(--panel); }
.fila:focus-visible { outline: 3px solid var(--verde); outline-offset: -3px; }

.avatar {
  flex: 0 0 50px;
  width: 50px; height: 50px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  font-weight: 800;
  background: var(--panel2);
  color: var(--texto);
  border: 1px solid var(--linea);
}
.avatar.marca {
  background: var(--verde);
  color: #06281a;
  border-color: transparent;
}

.fila-cuerpo { flex: 1 1 auto; min-width: 0; }
.fila-nombre {
  font-size: var(--t-nombre);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fila-ultimo {
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fila-lado {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-left: 6px;
}
.fila-hora { font-size: 13px; color: var(--muted); }

.insignia {
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 13px;
  background: var(--verde);
  color: #06281a;
  font-size: 14px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Estados (círculos) ---------- */
.estados {
  display: flex;
  gap: 14px;
  padding: 4px 14px 10px;
  overflow-x: auto;
}
.estado {
  flex: 0 0 auto;
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.estado-bola {
  width: 62px; height: 62px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  font-weight: 800;
  background: var(--panel);
  border: 3px solid var(--verde);
  color: var(--texto);
}
.estado-bola.mia { border-style: dashed; border-color: var(--muted); }
.estado-nombre {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Tarjetas ---------- */
.tarjeta {
  margin: 10px 14px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--linea);
  border-radius: 16px;
}
.tarjeta-metrica {
  margin: 10px 14px;
  padding: 16px;
  background: var(--panel2);
  border: 1px solid var(--linea);
  border-left: 5px solid var(--verde);
  border-radius: 16px;
}
.tarjeta-meta {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.tarjeta-titulo {
  margin: 0;
  font-size: var(--t-nombre);
  font-weight: 700;
}
.tarjeta-texto {
  margin: 8px 0 0;
  font-size: var(--t-base);
  color: var(--texto);
}
.metrica-verde {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--verde);
}
.cifra {
  margin: 4px 0 0;
  font-size: var(--t-grande);
  font-weight: 800;
}
.barra-progreso {
  margin-top: 10px;
  height: 12px;
  border-radius: 6px;
  background: #0b1220;
  border: 1px solid var(--linea);
  overflow: hidden;
}
.barra-progreso span {
  display: block;
  height: 100%;
  background: var(--verde);
}

.tarjeta-apagada {
  margin: 10px 14px;
  padding: 14px;
  background: var(--panel2);
  border: 1px dashed var(--linea);
  border-radius: 16px;
  color: var(--muted);
}

/* ---------- Botones ---------- */
.boton {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: var(--t-nombre);
  font-weight: 700;
  color: var(--texto);
  background: var(--panel2);
  border: 1px solid var(--linea);
  border-radius: 14px;
  cursor: pointer;
}
.boton:focus-visible { outline: 3px solid var(--verde); outline-offset: 2px; }
.boton-verde {
  background: var(--verde);
  border-color: var(--verde);
  color: #06281a;
}
.boton-grande {
  min-height: 66px;
  font-size: var(--t-titulo);
  font-weight: 800;
  border-radius: 18px;
}
.boton-medio { font-size: var(--t-base); min-height: 46px; }
.boton[disabled] { opacity: 0.6; cursor: default; }

/* ---------- Conversación ---------- */
.conversacion {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.hilo {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.burbuja {
  max-width: 84%;
  padding: 10px 12px 8px;
  font-size: var(--t-base);
  border-radius: 14px;
  white-space: pre-wrap;
}
.burbuja.entra {
  align-self: flex-start;
  background: var(--burbuja-entra);
  border-bottom-left-radius: 4px;
}
.burbuja.sale {
  align-self: flex-end;
  background: var(--verde-salida);
  border-bottom-right-radius: 4px;
}
.burbuja-pie {
  margin-top: 4px;
  font-size: 12.5px;
  color: #cfe0ff;
  text-align: right;
  opacity: 0.85;
}

.aviso-chat {
  align-self: stretch;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--linea);
  border-left: 5px solid var(--verde);
  border-radius: 14px;
}
.aviso-chat h3 {
  margin: 0;
  font-size: var(--t-nombre);
  font-weight: 800;
}
.aviso-chat p {
  margin: 8px 0 0;
  font-size: var(--t-base);
  color: var(--texto);
}

.entrada {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid var(--linea);
}
.entrada .campo { border-radius: 24px; }

.boton-enviar {
  flex: 0 0 52px;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 0;
  background: var(--verde);
  color: #06281a;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.boton-enviar[disabled] { opacity: 0.6; }

/* ---------- Pie + pestañas ---------- */
.inferior {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  background: var(--panel2);
  border-top: 1px solid var(--linea);
}
.pie {
  margin: 6px 10px 0;
  font-size: 13px;
  line-height: 1.3;
  color: var(--muted);
  text-align: center;
}

.tabs {
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 56px;
  padding: 14px 2px 12px;
  background: transparent;
  border: 0;
  border-top: 3px solid transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: var(--t-nombre);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.tab[aria-selected="true"] {
  color: var(--verde);
  border-top-color: var(--verde);
  background: var(--bg);
}
.tab:focus-visible { outline: 3px solid var(--verde); outline-offset: -3px; }

/* ---------- Pantalla de acceso ---------- */
.entrar { padding: 34px 20px; }
.entrar-caja { max-width: 460px; margin: 0 auto; }
.entrar-titulo {
  margin: 14px 0 6px;
  font-size: var(--t-titulo);
  font-weight: 800;
}
.entrar-texto { margin: 0 0 18px; color: var(--texto); }
.etiqueta {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}
.ayuda { margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.ayuda-error { color: #ffd9a8; font-weight: 700; }
.piesito {
  margin: 26px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.vacio {
  margin: 18px 14px;
  padding: 16px;
  background: var(--panel2);
  border: 1px dashed var(--linea);
  border-radius: 16px;
  color: var(--muted);
  font-size: var(--t-base);
}

@media (min-width: 520px) {
  .app { max-width: 520px; margin: 0 auto; border-left: 1px solid var(--linea); border-right: 1px solid var(--linea); }
  .barra, .inferior { position: sticky; }
  .inferior { position: fixed; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; }
  .conversacion { max-width: 520px; margin: 0 auto; }
}

/* 02/10/2026 — franja para activar el sonido cuando el navegador lo tiene bloqueado */
.franja-sonido{display:block;width:100%;background:#ffb35c;color:#1a1206;
  font:700 15px/1.35 'Segoe UI',system-ui,Arial;padding:12px 14px;border:none;text-align:center;cursor:pointer}
.franja-sonido:active{background:#e0a04f}

/* 03/10/2026 — los dos chulos: rojo = el otro todavía no lo ha visto · verde = ya lo vio */
.chulos{font-weight:700;letter-spacing:-1px}
.chulo-rojo{color:#ff6b6b}
.chulo-verde{color:#25d366}

/* ---------- Adjuntar archivos (fotos y documentos) ---------- */
.boton-adjuntar {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--linea);
  background: var(--panel2);
  color: var(--texto);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.boton-adjuntar:active { background: var(--panel); }

.archivo { max-width: 100%; }
.archivo-enlace {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}
.archivo-imagen {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
  border: 1px solid var(--linea);
}
.archivo-nombre {
  font-weight: 600;
  text-decoration: underline;
  word-break: break-word;
}
.archivo-pie {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  word-break: break-word;
}
.archivo-texto { margin-top: 6px; }

/* ---------- Videollamada ---------- */
.boton-video {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  background: var(--verde);
  color: #06281a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.video-aviso {
  border-left: 4px solid var(--verde);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}
.video-titulo {
  font-weight: 700;
  font-size: var(--t-nombre);
}
.video-entrar {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--verde);
  color: #06281a;
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Ficha del cliente (solo el negocio) ---------- */
.boton-ficha {
  background: var(--panel2);
  color: var(--texto);
  border: 1px solid var(--linea);
}
.contenido-ficha {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.campo-ficha { margin-bottom: 12px; }
.campo-ficha label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--texto);
  margin-bottom: 8px;
}
.campo-ficha textarea.campo {
  width: 100%;
  font-family: inherit;
  resize: vertical;
}
.ficha-estado {
  font-weight: 700;
  font-size: var(--t-nombre);
  margin: 6px 0;
  color: var(--verde);
}
.fila-mantenimiento {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--linea);
}
.mantenimiento-nombre { font-weight: 600; }
.mantenimiento-detalle { font-size: 14px; color: var(--muted); }
.fila-botones { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Cobros (Wompi) ---------- */
.cobro-aviso {
  border-left: 4px solid var(--verde);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}
.cobro-concepto { font-weight: 600; }
.cobro-monto {
  font-size: var(--t-grande);
  font-weight: 800;
  margin: 2px 0 8px;
}
.cobro-pagar {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 22px;
  background: var(--verde);
  color: #06281a;
  font-weight: 700;
  text-decoration: none;
}
.cobro-pagado { color: var(--verde); font-weight: 700; }
.cobro-rechazado { color: #ff9a9a; font-weight: 700; }

/* ---------- QR del mostrador ---------- */
.qr-caja {
  background: #ffffff;
  padding: 12px;
  border-radius: 14px;
  display: flex;
  justify-content: center;
  margin: 8px 0;
}
.qr-imagen svg {
  width: 230px;
  height: 230px;
  display: block;
}
.qr-vence {
  font-weight: 700;
  color: var(--verde);
  margin: 6px 0;
}

/* ---------- Mis negocios (el dueño con varios) ---------- */
.fila-negocio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--linea);
}
.negocio-bola { background: var(--verde); }
.negocio-datos { flex: 1 1 auto; }
.negocio-actual {
  font-size: 14px;
  font-weight: 700;
  color: var(--verde);
}

/* ---------- Presupuestos ---------- */
.presupuesto-aviso {
  border-left: 4px solid var(--linea-fuerte);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}
.presupuesto-numero {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.presupuesto-monto {
  font-size: var(--t-grande);
  font-weight: 800;
  margin: 2px 0 6px;
}
.presupuesto-detalle {
  white-space: pre-wrap;
  margin-bottom: 6px;
}

/* ---------- Clientes del negocio ---------- */
.cliente-fila {
  padding: 12px 0;
  border-top: 1px solid var(--linea);
}
.cliente-cabeza {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chip {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.chip-verde { background: rgba(37, 211, 102, 0.18); color: var(--verde); }
.chip-gris { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.chip-apagado { background: rgba(255, 120, 120, 0.16); color: #ff9a9a; }
.avatar.marca, .marca-bola { background: var(--marca); }

/* ── Línea de llamada (voz) ─────────────────────────────────────────────── */
.llamada-caja {
  position: fixed; inset: 0; z-index: 80; background: #0b1017;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center;
}
#pantalla-llamada[hidden] { display: none; }
.llamada-bola {
  width: 104px; height: 104px; border-radius: 50%; background: var(--marca, #1f9d55);
  color: #06170d; font-size: 46px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 10px rgba(255,255,255,.04);
}
/* ── Llamada de grupo: cuadrícula con la imagen de cada uno ─────────────── */
/* La cuadrícula se queda con el espacio libre (si no, el padre flexible la aplasta a un par de
   dedos de alto) y las fichas NO se estiran: cada una respeta su proporción y, si no caben, la
   cuadrícula se desliza. */
.grupo-videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(42%, 1fr)); gap: 8px;
  width: min(96vw, 640px); flex: 1 1 auto; min-height: 44vh; max-height: 70vh; overflow-y: auto;
  align-content: start; align-items: start; }
.grupo-videos:empty { display: none; }
.tile-video { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden;
  background: #16233a; border: 1px solid #22314a; display: flex; align-items: center;
  justify-content: center; }
.tile-video video { width: 100%; height: 100%; object-fit: cover; background: #0d1522; }
.tile-video.grupo-vacio video { display: none; }
.tile-nombre { position: absolute; left: 8px; bottom: 6px; font-size: 12px; font-weight: 700;
  color: #fff; background: rgba(6, 12, 20, .55); padding: 2px 7px; border-radius: 9px; }
.tile-bola { font-size: 30px; font-weight: 800; color: #7ee2a8; }

/* ── Video dentro de la llamada ─────────────────────────────────────────── */
/* El cuadro de video se queda con el espacio libre de la pantalla (antes se encogía a un tercio
   de la altura porque es un hijo flexible y los demás elementos le comían el sitio). */
.llamada-video { position: relative; flex: 1 1 auto; align-self: center; width: min(96vw, 560px);
  min-height: 46vh; max-height: 72vh; border-radius: 18px; overflow: hidden;
  background: #0d1522; border: 1px solid #1e2a3c; }
.llamada-video[hidden] { display: none; }
#video-remoto { display: block; width: 100%; height: 100%; object-fit: cover; background: #0d1522; }
#video-propio { position: absolute; right: 10px; bottom: 10px; width: 28%; aspect-ratio: 3 / 4;
  object-fit: cover; border-radius: 12px; border: 2px solid rgba(255,255,255,.35); background: #16233a; }
#video-propio[hidden] { display: none; }
@media (orientation: landscape) { .llamada-video { min-height: 60vh; max-height: 82vh; } }
.llamada-nombre { margin: 0; font-size: 27px; color: #fff; }
.llamada-estado { margin: 0; font-size: 17px; color: #a9b8cd; }
.llamada-tiempo { margin: 0; font-size: 23px; color: #7ee2a8; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.llamada-botones { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.llamada-nota { margin: 0; max-width: 360px; font-size: 15px; line-height: 1.5; color: #8b9bb4; }
.recuperar-opciones { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.recuperar-opciones:empty { display: none; }
#recuperar-caja .campo { margin-bottom: 8px; }
.boton-rojo { background: #b0322b; border-color: #d4553f; color: #fff; }
.boton-rojo:hover { background: #c23a31; }

/* Botón para reintentar cuando una conversación no cargó */
.vacio-reintentar { display: flex; justify-content: center; padding: 14px 0 20px; }

/* ── Chat de grupo (la familia o los amigos) ─────────────────────────────── */
.burbuja-autor {
  font-size: 1rem;
  font-weight: 700;
  color: var(--verde);
  margin-bottom: .15rem;
}
.grupo-elegir {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: .6rem 0;
}
.grupo-persona {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: .7rem .9rem;
  font-size: 1.15rem;
  cursor: pointer;
}
.grupo-persona input {
  width: 26px;
  height: 26px;
  accent-color: var(--verde);
  flex: 0 0 auto;
}
.grupo-persona-nombre { color: var(--texto); }

/* ── Notas de voz ───────────────────────────────────────────────────────── */
.boton-grabar {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--borde);
  background: var(--panel);
  color: var(--texto);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.boton-grabar:active { border-color: var(--verde); }
.boton-grabar.grabando {
  background: #c62828;
  border-color: #ff6b6b;
  color: #fff;
  animation: latir 1s infinite;
}
@keyframes latir { 50% { opacity: .55; } }

.nota-voz {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-width: 200px;
}
.nota-voz audio {
  width: 100%;
  max-width: 320px;
  height: 44px;
  filter: invert(1) hue-rotate(180deg) brightness(1.05);
}
.nota-voz-pie { font-size: .95rem; opacity: .85; }

.barra-grabando {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1rem;
  background: #1b1b1b;
  border-top: 2px solid #c62828;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, .5);
}
.barra-grabando .punto {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff5252;
  animation: latir 1s infinite;
  flex: 0 0 auto;
}
.barra-grabando .tiempo { font-size: 1.4rem; font-weight: 700; color: #fff; flex: 1 1 auto; }
.barra-grabando button {
  font-size: 1.15rem;
  font-weight: 700;
  padding: .7rem 1rem;
  border-radius: 12px;
  border: 2px solid var(--borde);
  background: var(--panel);
  color: var(--texto);
  cursor: pointer;
}
.barra-grabando button.mandar { background: var(--verde); color: #06210f; border-color: var(--verde); }

/* ── Alta de círculo (RouTalks) ─────────────────────────────────────────── */
.entrar-separador {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 1.2rem 0 .6rem;
  color: var(--texto-suave, #9fb0c9);
  font-size: 1rem;
}
.entrar-separador::before, .entrar-separador::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--borde);
}
#entrar-nuevo .campo { margin-bottom: .5rem; }
#entrar-nuevo .boton { width: 100%; }

/* Franja del plan (prueba de 15 días) arriba de la lista de conversaciones. */
.franja-plan { margin: 0 12px 8px; padding: 10px 12px; border-radius: 12px; font-size: 14px;
  line-height: 1.4; background: rgba(255, 200, 60, 0.12); border: 1px solid rgba(255, 200, 60, 0.35);
  color: #f0d9a0; }
.franja-plan.plan-vencido { background: rgba(255, 90, 90, 0.13); border-color: rgba(255, 90, 90, 0.4);
  color: #ffbdbd; }
.franja-titulo { margin: 0; font-weight: 600; color: #fff; }
.franja-detalle { margin: 2px 0 0; }
.franja-plan button { margin-top: 8px; }
.plan-datos { margin: 2px 0 0; font-size: 14px; color: #9fb0c8; }

/* Aviso dentro de la conversación cuando la prueba del círculo ya venció. */
.aviso-plan { margin: 0 12px 6px; padding: 9px 12px; border-radius: 10px; font-size: 13.5px;
  line-height: 1.4; background: rgba(255, 90, 90, 0.13); border: 1px solid rgba(255, 90, 90, 0.38);
  color: #ffbdbd; }

/* Botones del plan (pagar, revisar, seguir gratis). */
.plan-botones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.plan-botones .boton { margin: 0; }
.plan-botones .boton-suave { background: transparent; border: 1px solid rgba(255, 255, 255, 0.22);
  color: #cfd8e6; }

/* Casilla de aceptación de los términos al crear el círculo. */
.acepto { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 12px; font-size: 14.5px;
  line-height: 1.45; color: #b9c6d8; }
.acepto input { width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 auto; accent-color: #25d366; }
.acepto a { color: #7ee0a4; }
/* Tarjeta de textos legales. */
.legal-enlaces { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.legal-enlaces a { color: #7ee0a4; font-size: 15px; text-decoration: none;
  border-bottom: 1px solid rgba(126, 224, 164, .35); padding-bottom: 1px; }
.piesito a { color: #8fa0b8; }

/* Aviso de pauta en la lista de conversaciones (solo círculos en modo gratis). */
.pauta-caja { margin: 10px 12px 4px; padding: 12px 13px 13px; border-radius: 12px; position: relative;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.10); }
.pauta-sello { position: absolute; top: -9px; left: 12px; font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; background: #16202f; color: #9fb0c8; padding: 2px 8px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12); }
.pauta-titulo { margin: 4px 0 4px; font-size: 16px; font-weight: 600; color: #eaf1fb; }
.pauta-texto { margin: 0 0 8px; font-size: 14px; line-height: 1.45; color: #b9c6d8; }
.pauta-boton { display: inline-block; font-size: 14px; padding: 8px 14px; border-radius: 9px;
  background: #25d366; color: #08130c; text-decoration: none; font-weight: 600; }
.pauta-imagen { display: block; width: 100%; max-height: 130px; object-fit: cover; border-radius: 9px;
  margin: 2px 0 8px; }
.pauta-puntos { display: flex; gap: 6px; justify-content: center; margin-top: 9px; }
.pauta-punto { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.22); }
.pauta-punto.actual { background: #25d366; }

/* Panel de la conversación: denunciar y bloquear. */
.convo-menu { margin: 0 12px 8px; padding: 12px 13px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); }
.convo-menu .tarjeta-titulo { margin: 0 0 6px; font-size: 16px; }
.convo-menu .ayuda { margin: 6px 0 0; }
.convo-motivos { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.convo-motivos button { font-size: 14px; padding: 8px 12px; border-radius: 9px; cursor: pointer;
  background: transparent; color: #cfd8e6; border: 1px solid rgba(255,255,255,.22); }
.convo-motivos button.elegido { background: rgba(255,90,90,.16); border-color: rgba(255,90,90,.5); color: #ffd0d0; }
.convo-menu textarea { width: 100%; min-height: 62px; margin: 6px 0 8px; padding: 9px 11px; font: inherit;
  font-size: 15px; color: #eaf1fb; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px; resize: vertical; }
.convo-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.convo-acciones .peligro { background: rgba(255,90,90,.18); border: 1px solid rgba(255,90,90,.5); color: #ffd0d0; }
.borrar-cuenta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.borrar-cuenta input { flex: 1 1 140px; padding: 9px 11px; font: inherit; font-size: 15px; color: #eaf1fb;
  background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.16); border-radius: 10px; }

/* Conmutador de Círculos Sociales (un teléfono con varios círculos). */
.acceso-fila { display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.07); }
.acceso-fila:last-child { border-bottom: none; }
.acceso-datos { flex: 1 1 auto; min-width: 0; }
.acceso-nombre { margin: 0; font-size: 15.5px; color: #eaf1fb; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.acceso-meta { margin: 2px 0 0; font-size: 13px; color: #93a2b8; }
.acceso-actual { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: #7ee0a4;
  border: 1px solid rgba(126,224,164,.4); border-radius: 999px; padding: 2px 8px; }
.acceso-quitar { background: transparent; border: 1px solid rgba(255,90,90,.4); color: #ffbdbd;
  border-radius: 8px; padding: 4px 9px; font-size: 13px; cursor: pointer; }
.enlace-caja { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.enlace-caja input { flex: 1 1 auto; min-width: 0; font-size: 12.5px; padding: 8px 10px; color: #cfd8e6;
  background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.16); border-radius: 9px; }
.nuevo-circulo { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.nuevo-circulo input { flex: 1 1 150px; padding: 9px 11px; font: inherit; font-size: 15px; color: #eaf1fb;
  background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.16); border-radius: 10px; }

/* Alerta de los otros Círculos Sociales del mismo teléfono. */
.franja-otro { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: #1b2740; border: 1px solid #2f4670; border-left: 4px solid #ffc857; border-radius: 10px;
  padding: 9px 11px; margin: 6px 0 0; color: #eaf1fb; font: inherit; font-size: 14.5px; cursor: pointer; }
.franja-otro.llamada { border-left-color: #ff6b6b; background: #2a1c22; border-color: #5c2f3a; }
.franja-otro b { color: #ffffff; }
.franja-otro .franja-otro-boton { margin-left: auto; flex: 0 0 auto; background: #25d366; color: #10141c;
  border-radius: 999px; padding: 6px 13px; font-weight: bold; font-size: 13.5px; }
.franja-otro.llamada .franja-otro-boton { background: #ff6b6b; color: #ffffff; }

/* Aviso de que alguien intentó entrar desde otro teléfono (lo ve el CEO en su lista). */
.aviso-intento { margin: 4px 0 2px; padding: 6px 9px; border-left: 3px solid #ffc857;
  background: rgba(255,200,87,.10); border-radius: 6px; color: #ffe3a3; font-size: 13.5px; }

/* ── Respuestas rápidas y horario de atención (Hueco 5) ───────────────────────── */
.boton-respuestas {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: transparent; color: var(--acento, #2fbf71); cursor: pointer; flex: 0 0 auto;
}
.boton-respuestas:hover { background: rgba(47, 191, 113, .12); }
.respuestas-caja {
  margin: 0 8px 8px; padding: 10px 12px; border-radius: 14px;
  background: var(--panel-2, #262a30); border: 1px solid rgba(255, 255, 255, .08);
  max-height: 45vh; overflow-y: auto;
}
.respuesta-boton {
  display: block; width: 100%; text-align: left; margin: 4px 0; white-space: normal;
  line-height: 1.3;
}
.aviso-horario {
  margin: 0 8px 8px; padding: 10px 12px; border-radius: 14px;
  background: rgba(255, 190, 60, .10); border: 1px solid rgba(255, 190, 60, .35);
}
.fila-dia { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.fila-dia-nombre { flex: 1 1 90px; font-size: .95rem; }
.campo-hora { flex: 0 0 108px; padding: 6px 8px; text-align: center; }
.campo-texto { width: 100%; margin: 6px 0; font-family: inherit; font-size: 1rem; resize: vertical; }
.fila-dia-guion { opacity: .7; font-size: .9rem; }

/* ── Buscar y filtrar (hueco 6) ───────────────────────────────────────────────── */
.filtros { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; align-items: center; }
.chip-boton {
  border: 1px solid rgba(255, 255, 255, .18); background: transparent; color: inherit;
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .9rem; cursor: pointer;
}
.chip-boton.activo { background: var(--acento, #2fbf71); border-color: var(--acento, #2fbf71); color: #08150d; font-weight: 600; }
.chip-boton.quitar { border-style: dashed; opacity: .9; }
.filtros .cuenta { margin-left: auto; font-size: .85rem; opacity: .8; }
@media (max-width: 420px) { .filtros { padding-left: 8px; padding-right: 8px; } }

/* Quién atendió: va en el pie de la burbuja, discreto (solo lo ve el negocio). */
.burbuja-atendio { opacity: .75; font-size: .78rem; }

/* La pantalla de arranque: el logotipo de la app, su nombre y de qué tipo es. */
/* La portada: capa propia encima de todo (por debajo de la ayuda), con su desvanecido de salida. */
.inicio-app { position: fixed; inset: 0; z-index: 55; background: var(--bg); padding: 13vh 24px 40px;
              text-align: center; opacity: 1; transition: opacity .34s ease; }
.inicio-app.yendose { opacity: 0; }
.inicio-app[hidden] { display: none !important; }
.inicio-logo { width: 112px; height: 112px; border-radius: 26px; display: block; margin: 0 auto 16px;
               box-shadow: 0 10px 26px rgba(0, 0, 0, .45); }
.inicio-nombre { margin: 0; font-size: 26px; font-weight: 700; color: var(--texto); }
.inicio-tipo { margin: 5px 0 20px; font-size: 15px; color: var(--verde); }
.inicio-espera { margin: 0; font-size: 14px; color: var(--muted); }

/* ═══════════ la ayuda: botón flotante y ventana ═══════════ */
.ventana-ayuda-boton {
  position: fixed; right: 16px; bottom: 78px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: var(--verde); color: #07130c; font-size: 21px; font-weight: 800; line-height: 1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45); cursor: pointer;
}
.ventana-ayuda-boton[hidden] { display: none !important; }
.ventana-ayuda-boton:active { transform: scale(.94); }

.ventana-ayuda { position: fixed; inset: 0; z-index: 60; }
.ventana-ayuda[hidden] { display: none !important; }
.ventana-ayuda-fondo { position: absolute; inset: 0; background: rgba(4, 8, 15, .62); }
.ventana-ayuda-caja {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 84vh; display: flex; flex-direction: column;
  background: var(--panel); border-top: 1px solid var(--linea);
  border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .5);
}
.ventana-ayuda-cabeza {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--linea);
}
.ventana-ayuda-titulo { margin: 0; font-size: var(--t-titulo); font-weight: 700; color: var(--texto); }
.ventana-ayuda-cerrar {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--linea);
  background: var(--panel2); color: var(--texto); font-size: 17px; cursor: pointer;
}
.ventana-ayuda-cuerpo { padding: 12px 16px 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ventana-ayuda-tema { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
              color: var(--verde); }
.ventana-ayuda-tema:not(:first-child) { margin-top: 20px; }
.ventana-ayuda-punto { margin: 0 0 12px; }
.ventana-ayuda-punto b { display: block; font-size: 15px; color: var(--texto); }
.ventana-ayuda-punto span { display: block; margin-top: 3px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.ventana-ayuda-pie {
  display: flex; gap: 10px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--linea);
}
.ventana-ayuda-pie .boton { flex: 1; }
.ventana-ayuda-pie .boton[hidden] { display: none !important; }

/* El logotipo de la portada entra con un aparecer corto (impresión de app, no de pantalla en blanco). */
@keyframes aparecer { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.inicio-logo, .inicio-nombre, .inicio-tipo { animation: aparecer .5s ease both; }
.inicio-nombre { animation-delay: .08s; }
.inicio-tipo { animation-delay: .16s; }

/* ═══════ la franja de publicidad del plan gratis ═══════ */
.franja-publicidad { position: fixed; left: 0; right: 0; bottom: 58px; z-index: 15; display: flex;
  align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; font-size: 14px;
  background: var(--panel2); border-top: 1px solid var(--linea); color: var(--suave); }
.franja-publicidad[hidden] { display: none !important; }
.franja-publicidad a { color: var(--texto); font-weight: 600; }
.franja-publicidad-nota { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--suave);
  border: 1px solid var(--linea); border-radius: 999px; padding: 2px 7px; }
