/* FINDLEY MEDICAL · Sala Findley (videollamada) */
body:has(.sala) .wa-flotante, body:has(.sala) .btn-acceso, body:has(.sala) .te-boton, body:has(.sala) .pulso-lectura { display: none !important; }
.sala { min-height: 100vh; background: radial-gradient(900px 500px at 80% -10%, #e8f0ff, transparent 70%), #f6f9fc; padding: 96px 16px 40px; }

/* ── Sala de espera ── */
.sala-lobby { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: center; }
.sala-lobby-video { position: relative; aspect-ratio: 16 / 10; border-radius: 26px; overflow: hidden; background: #0b1f33; box-shadow: 0 30px 70px -30px rgba(11, 31, 51, .55); }
.sala-lobby-video video { width: 100%; height: 100%; object-fit: cover; }
.espejo { transform: scaleX(-1); }
.sala-sin-cam, .sala-remoto-sincam { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: #c9d6e4; background: #0f2740; }
.sala-sin-cam[hidden], .sala-remoto-sincam[hidden] { display: none; }
.sala-sin-cam span, .sala-remoto-sincam span { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 40px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #155eef, #12b5a6); }
.sala-mini-controles { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 10px; }
.sala-nivel { position: absolute; left: 16px; bottom: 26px; width: 70px; height: 6px; border-radius: 9px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.sala-nivel span { display: block; height: 100%; width: 0; background: #3ddc97; transition: width .1s; }
.sala-marca { font-size: 13px; color: var(--gris); font-weight: 600; }
.sala-marca b { color: var(--tinta); } .sala-marca i { font-style: normal; color: var(--azul); font-weight: 800; }
.sala-lobby-info h1 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -.03em; line-height: 1.15; margin-top: 10px; }
.sala-cuando { color: var(--gris); margin-top: 8px; text-transform: none; }
.sala-cuando::first-letter { text-transform: uppercase; }
.sala-estado-otro { margin-top: 18px; font-size: 15px; display: flex; align-items: center; gap: 8px; min-height: 22px; }
.punto { width: 10px; height: 10px; border-radius: 50%; background: var(--gris-claro); display: inline-block; }
.punto.verde { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .2); animation: latido 1.6s infinite; }
.punto.amarillo { background: #f5a524; }
@keyframes latido { 50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } }
.sala-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.sala-checks span { font-size: 12.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.sala-checks .ok { background: var(--menta); color: var(--teal-osc); } .sala-checks .no { background: #fff1f1; color: #a3242a; }
.sala-consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: 13.5px; color: var(--tinta-2); line-height: 1.45; cursor: pointer; }
.sala-consent[hidden] { display: none; }
.sala-consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--azul); flex: none; }
.sala-entrar { width: 100%; justify-content: center; margin-top: 20px; padding: 16px; font-size: 16px; }
.sala-entrar:disabled { opacity: .45; cursor: not-allowed; }
.sala-probar { margin-top: 10px; border: 0; background: none; color: var(--azul); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }

/* ── Botones redondos ── */
.sc { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .14); backdrop-filter: blur(10px); transition: background .2s, transform .15s; }
.sc:hover { background: rgba(255, 255, 255, .26); }
.sc:active { transform: scale(.92); }
.sc svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sc[data-mas] svg { fill: currentColor; stroke: none; }
.sc.apagado { background: #ea4335; }
.sc.activo { background: var(--azul); }
.sc-colgar { background: #ea4335; width: 64px; border-radius: 26px; }
.sc-colgar svg { fill: currentColor; stroke: none; }
.sc-colgar:hover { background: #c5221f; }
.sc[hidden] { display: none; }
.sala-badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; border-radius: 10px; background: #ea4335; color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 5px; }
.sala-badge[hidden] { display: none; }

/* ── Llamada ── */
.sala-llamada { position: fixed; inset: 0; z-index: 200; background: #0a1522; color: #fff; overflow: hidden; }
.sala-llamada[hidden] { display: none; }
.sala-escena { position: absolute; inset: 0; }
.sala-remoto { width: 100%; height: 100%; object-fit: contain; background: #0a1522; }
.sala-espera { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: 10px; padding: 20px; background: radial-gradient(600px 400px at 50% 40%, #12305a, #0a1522); }
.sala-espera[hidden] { display: none; }
.sala-espera p { font-size: 20px; font-weight: 700; }
.sala-espera small { color: #9fb3c8; max-width: 360px; }
.sala-pulso { width: 90px; height: 90px; border-radius: 50%; background: linear-gradient(135deg, #155eef, #12b5a6); animation: pulso 1.8s ease-in-out infinite; margin-bottom: 8px; }
@keyframes pulso { 0%, 100% { transform: scale(.9); box-shadow: 0 0 0 0 rgba(21, 94, 239, .5); } 50% { transform: scale(1); box-shadow: 0 0 0 26px rgba(21, 94, 239, 0); } }
.sala-etiqueta-remoto { position: absolute; left: 18px; bottom: 104px; font-size: 14px; font-weight: 700; background: rgba(0, 0, 0, .45); padding: 6px 12px; border-radius: 10px; backdrop-filter: blur(6px); }
.sala-local-caja { position: absolute; right: 18px; bottom: 104px; width: clamp(120px, 20vw, 260px); aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; background: #0f2740; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); border: 2px solid rgba(255, 255, 255, .15); cursor: grab; touch-action: none; transition: right .25s, left .25s, top .25s, bottom .25s; z-index: 3; }
.sala-local-caja[data-esquina="ai"] { right: auto; left: 18px; bottom: auto; top: 70px; }
.sala-local-caja[data-esquina="ad"] { bottom: auto; top: 70px; }
.sala-local-caja[data-esquina="bi"] { right: auto; left: 18px; }
.sala-local { width: 100%; height: 100%; object-fit: cover; }
.sala-local-sincam { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: #9fb3c8; }
.sala-local-sincam[hidden] { display: none; }
/* Intercambio: tú en grande, la otra persona en chico */
.sala-escena.invertida .sala-local-caja { inset: 0; width: auto; aspect-ratio: auto; border-radius: 0; border: 0; z-index: 0; }
.sala-escena.invertida .sala-remoto { position: absolute; right: 18px; bottom: 104px; width: clamp(120px, 20vw, 260px); height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; z-index: 3; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); }
.sala-arriba { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: linear-gradient(180deg, rgba(0, 0, 0, .5), transparent); font-size: 13px; z-index: 4; transition: opacity .3s; }
.sala-priv { opacity: .85; }
.sala-tiempo { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; background: rgba(255, 255, 255, .12); padding: 4px 10px; border-radius: 8px; }
.sala-calidad { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.sala-calidad i { width: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); }
.sala-calidad i:nth-child(1) { height: 6px; } .sala-calidad i:nth-child(2) { height: 11px; } .sala-calidad i:nth-child(3) { height: 16px; }
.sala-calidad[data-nivel="3"] i { background: #3ddc97; }
.sala-calidad[data-nivel="2"] i:nth-child(-n+2) { background: #f5c542; }
.sala-calidad[data-nivel="1"] i:nth-child(1) { background: #ea4335; }
.sala-controles { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 10px; padding: 10px 14px; border-radius: 999px; background: rgba(15, 30, 48, .72); backdrop-filter: blur(14px); box-shadow: 0 16px 40px rgba(0, 0, 0, .35); z-index: 5; transition: opacity .3s, transform .3s; }
.sala-llamada.quieta .sala-controles { opacity: 0; transform: translate(-50%, 20px); pointer-events: none; }
.sala-llamada.quieta .sala-arriba { opacity: 0; }
.sala-toast { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); z-index: 6; max-width: min(560px, 92vw); background: rgba(255, 255, 255, .97); color: var(--tinta); padding: 12px 18px; border-radius: 14px; font-size: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .3); text-align: center; }
.sala-toast[hidden] { display: none; }
.sala-toast a { color: var(--azul); font-weight: 700; }
.sala-subs { position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); max-width: min(760px, 90vw); background: rgba(0, 0, 0, .72); padding: 10px 16px; border-radius: 12px; font-size: 18px; line-height: 1.4; text-align: center; z-index: 4; }
.sala-subs:empty { display: none; }
.sala-menu { position: absolute; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 7; background: #fff; color: var(--tinta); border-radius: 18px; padding: 8px; min-width: 290px; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); }
.sala-menu[hidden] { display: none; }
.sala-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-size: 14.5px; padding: 11px 14px; border-radius: 12px; cursor: pointer; }
.sala-menu button:hover { background: var(--fondo-2); }
.sala-menu button[hidden] { display: none; }

/* ── Chat ── */
.sala-chat { position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 100vw); background: #fff; color: var(--tinta); z-index: 8; display: flex; flex-direction: column; box-shadow: -20px 0 50px rgba(0, 0, 0, .3); }
.sala-chat[hidden] { display: none; }
.sala-chat header { display: flex; justify-content: space-between; align-items: center; padding: 18px; border-bottom: 1px solid var(--linea); }
.sala-chat header button { border: 0; background: var(--fondo-2); width: 32px; height: 32px; border-radius: 50%; font-size: 20px; cursor: pointer; }
.sala-chat-lista { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sala-chat-vacio { color: var(--gris); font-size: 13px; text-align: center; margin: auto 0; }
.msg { max-width: 85%; align-self: flex-start; }
.msg p { background: var(--fondo-2); padding: 10px 13px; border-radius: 16px 16px 16px 4px; font-size: 14.5px; word-break: break-word; }
.msg.mio { align-self: flex-end; text-align: right; }
.msg.mio p { background: var(--azul); color: #fff; border-radius: 16px 16px 4px 16px; text-align: left; }
.msg.mio a { color: #fff; }
.msg small { font-size: 11px; color: var(--gris); }
.sala-chat form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--linea); }
.sala-chat input { flex: 1; border: 1px solid var(--linea-2); border-radius: 999px; padding: 11px 16px; font: inherit; font-size: 15px; }
.sala-chat form button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--azul); color: #fff; font-size: 16px; cursor: pointer; }

/* ── Ajustes ── */
.sala-modal { position: fixed; inset: 0; z-index: 300; background: rgba(11, 31, 51, .55); display: grid; place-items: center; padding: 16px; }
.sala-modal[hidden] { display: none; }
.sala-modal-caja { background: #fff; color: var(--tinta); border-radius: 22px; padding: 22px; width: min(440px, 100%); display: grid; gap: 12px; max-height: 92vh; overflow: auto; }
.sala-modal-caja header { display: flex; justify-content: space-between; align-items: center; }
.sala-modal-caja header button { border: 0; background: var(--fondo-2); width: 32px; height: 32px; border-radius: 50%; font-size: 20px; cursor: pointer; }
.sala-modal .campo[hidden], .sala-check[hidden] { display: none; }
.sala-check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.sala-check input { accent-color: var(--azul); width: 17px; height: 17px; }

/* ── Fin ── */
.sala-fin { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: #f6f9fc; }
.sala-fin[hidden] { display: none; }
.sala-fin-caja { background: #fff; border-radius: 26px; padding: 34px 28px; max-width: 480px; text-align: center; box-shadow: var(--sombra-suave); }
.sala-fin-caja h1 { font-size: 26px; letter-spacing: -.02em; }
.sala-fin-caja p { color: var(--gris); margin-top: 10px; }
.sala-fin-botones { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.sala-fin-estrellas { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }
.sala-fin-estrellas a { font-size: 48px; color: var(--linea-2); text-decoration: none; transition: color .1s, transform .1s; }
.sala-fin-estrellas:hover a { color: #f5a524; }
.sala-fin-estrellas a:hover ~ a { color: var(--linea-2); }
.sala-fin-estrellas a:active { transform: scale(1.2); }

@media (max-width: 860px) {
  .sala { padding-top: 84px; }
  .sala-lobby { grid-template-columns: 1fr; gap: 22px; }
  .sala-lobby-video { aspect-ratio: 3 / 4; max-height: 52vh; }
  .sc { width: 48px; height: 48px; }
  .sala-controles { gap: 6px; padding: 8px 10px; bottom: 16px; }
  .sala-remoto { object-fit: cover; }
  .sala-local-caja { width: 110px; aspect-ratio: 3 / 4; bottom: 96px; right: 12px; }
  .sala-etiqueta-remoto { bottom: 96px; left: 12px; }
}

.sala-menu .solo-angosto { display: none; }
@media (max-width: 440px) {
  .sc { width: 44px; height: 44px; }
  .sc svg { width: 22px; height: 22px; }
  .sc-colgar { width: 58px; }
  .sala-controles { gap: 5px; padding: 7px 9px; }
  .sala-controles [data-cc], .sala-controles [data-pantalla] { display: none; }
  .sala-menu .solo-angosto { display: block; }
  .sala-menu { min-width: 0; width: calc(100vw - 24px); }
}
body.en-sala { overflow: hidden; }

/* Fotos en el chat de la sesión */
.sala-chat form .chat-foto { flex: none; border: 0; background: var(--fondo-2); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--azul, #1f6bff); }
.sala-chat form .chat-foto i { width: 20px; height: 20px; }
.chat-foto-nota { margin: 0; padding: 0 16px 12px; font-size: 11.5px; color: var(--gris); }
.msg-foto { display: block; border: 0; padding: 0; background: none; cursor: zoom-in; border-radius: 14px; overflow: hidden; }
.msg-foto img { display: block; max-width: 220px; max-height: 260px; width: auto; height: auto; border-radius: 14px; }
.msg.mio .msg-foto { margin-left: auto; }
.foto-visor { position: fixed; inset: 0; z-index: 400; background: rgba(5, 12, 24, .92); display: grid; place-items: center; padding: 20px; }
.foto-visor[hidden] { display: none; }
.foto-visor img { max-width: calc(100vw - 40px); max-height: calc(100vh - 40px); object-fit: contain; border-radius: 12px; touch-action: pinch-zoom; }
.foto-visor button { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; display: grid; place-items: center; cursor: pointer; }

/* Logo chiquito de Findley Medical en la llamada (lo ven el doctor y el paciente) y en el chat */
.sala-logo { position: absolute; top: 14px; right: 14px; z-index: 4; font-size: 15px; background: rgba(255, 255, 255, .92); padding: 6px 10px 5px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); pointer-events: none; }
.chat-titulo { display: inline-flex; align-items: center; gap: 10px; }
.chat-logo { font-size: 13px; }
.sala-marca-logo { font-size: 12px; vertical-align: middle; }

/* Aviso cuando se oculta un dato de contacto */
.msg-nota{display:flex;gap:8px;align-items:flex-start;margin:8px 0;padding:9px 11px;border-radius:12px;background:#eef4ff;color:#1b3a63;font-size:12.5px;line-height:1.45}
.msg-nota p{margin:0}
.msg-nota i{flex-shrink:0;margin-top:1px;color:#155eef}

/* Receta digital en la sala */
.chat-receta { color: #155eef; }
.msg-receta { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; padding: 12px 14px; border-radius: 14px; background: #0B1F33; color: #fff; max-width: 85%; }
.msg-receta.mio { margin-left: auto; }
.msg-receta span { display: flex; gap: 6px; align-items: center; font-size: 14.5px; }
.msg-receta i { color: #2FD4C8; }
.msg-receta small { color: #b9c8db; font-size: 12px; }
.msg-receta a { align-self: flex-start; margin-top: 4px; background: #2FD4C8; color: #0B1F33; border-radius: 10px; padding: 8px 12px; font-weight: 800; font-size: 13.5px; text-decoration: none; }
.sala-pregunta { position: fixed; inset: 0; z-index: 550; background: rgba(4,17,31,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sala-pregunta > div { background: #fff; color: #0B1F33; border-radius: 22px; padding: 22px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.sala-pregunta h2 { margin: 0; font-size: 21px; }
.sala-pregunta p { margin: 0 0 4px; color: #5b6b7f; }
.sala-pregunta .btn { display: flex; align-items: center; justify-content: center; gap: 6px; }
.sala-pregunta-volver { border: 0; background: none; color: #5b6b7f; font: 600 14px inherit; cursor: pointer; padding: 8px; }
.sala-fin-rx { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }

.sala-chat form .chat-foto[hidden] { display: none; }

/* Nota IA: aviso al paciente */
.sala-nota-aviso { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); width: min(560px, 92vw); box-sizing: border-box; background: rgba(11, 31, 51, .9); color: #fff; padding: 10px 12px 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.4; display: flex; gap: 10px; align-items: center; z-index: 5; }
.sala-nota-aviso[hidden] { display: none; }
.sala-nota-aviso button { flex-shrink: 0; border: 1px solid rgba(255, 255, 255, .5); background: transparent; color: #fff; border-radius: 999px; padding: 6px 12px; font: 700 13px inherit; cursor: pointer; }
