/* Ver en vivo el navegador que usa Claude (pn-…) y una miniapp abierta (ma-…). */

/* MARK: La tarjeta dentro del chat */

.pn-tarjeta {
  max-width: calc(560 * var(--u)); border-radius: 14px; overflow: hidden; background: #000;
  box-shadow: inset 0 0 0 1px rgba(var(--p), .12); position: relative; flex: none;
}
.pn-tarjeta > header { display: flex; align-items: center; gap: 8px; height: calc(36 * var(--u)); padding: 0 6px 0 12px; font-size: var(--f12); color: #fff; }
.pn-tarjeta > header b { font-weight: 600; }
.pn-tarjeta > header .boton-icono { color: rgba(255, 255, 255, .7); }
.pn-tarjeta > header .boton-icono:hover { background: rgba(255, 255, 255, .14); }
.pn-termino { color: var(--verde); }
.pn-punto { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; animation: pn-latir .9s ease-in-out infinite alternate; }
@keyframes pn-latir { to { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pn-punto { animation: none; } }
.pn-ver { display: block; width: 100%; cursor: pointer; }
.pn-mini { aspect-ratio: 1440 / 900; background: #000; }
.pn-mini iframe { display: block; width: 100%; height: 100%; border: 0; pointer-events: none; background: #000; }
.pn-nota {
  display: flex; gap: 9px; padding: 10px 12px; background: rgba(var(--p), .06); box-shadow: none; border-radius: 12px;
  font-size: var(--f12); line-height: 1.45; color: var(--texto2);
}
.pn-nota > .ico { margin-top: 2px; }
.pn-nota .boton { display: flex; margin-top: 8px; }

.pn-boton { position: relative; }
.pn-boton .pn-punto { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; box-shadow: 0 0 0 2px var(--fondo); }

/* MARK: El visor grande */

.hoja.pn-hoja {
  width: min(1500px, calc(100vw - 40px)); height: calc(100dvh - 40px); max-height: none; overflow: hidden;
  display: flex; flex-direction: column; background: var(--fondo);
}
.pn-visor { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pn-cabeza { flex: none; display: flex; align-items: center; gap: 6px; height: calc(44 * var(--u)); padding: 0 8px 0 16px; border-bottom: 1px solid var(--borde); }
.pn-titulo { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: var(--f13); }
.pn-titulo b { font-weight: 600; }
.pn-titulo small { color: var(--texto2); font-size: var(--f115); }
.pn-cerrar-movil { display: none; }
.pn-cerrar { width: 28px; height: 28px; }
.pn-modo {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: calc(28 * var(--u)); padding: 0 11px; border-radius: 99px;
  font-size: var(--f125); font-weight: 600; color: var(--texto); background: rgba(var(--p), .08);
}
.pn-modo:hover:not(:disabled) { background: rgba(var(--p), .14); }
.pn-modo.usando { color: var(--azul); background: color-mix(in srgb, var(--azul) 16%, transparent); }
.pn-modo.soltar { color: var(--rojo); background: color-mix(in srgb, var(--rojo) 16%, transparent); }
.pn-modo:disabled { opacity: .6; }

.pn-tira {
  flex: none; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px; overflow-x: auto; overflow-y: hidden;
  border-bottom: 1px solid var(--borde); background: var(--tira); scrollbar-width: none;
}
.pn-tira::-webkit-scrollbar { display: none; }
.pn-tira-nota { display: block; flex: 1 1 0; min-width: 0; padding: 0 6px; font-size: var(--f115); color: var(--texto2); }
.pn-tira-nota .ico { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.pn-ficha {
  flex: none; display: flex; align-items: center; gap: 6px; height: 32px; max-width: 190px; padding: 0 3px 0 9px; border-radius: 9px; cursor: pointer;
  background: rgba(var(--p), .07); font-size: var(--f115); box-shadow: inset 0 0 0 1px transparent;
}
.pn-ficha:hover { background: rgba(var(--p), .11); }
.pn-ficha.activa { background: color-mix(in srgb, var(--azul) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--azul) 60%, transparent); font-weight: 600; }
.pn-icono { flex: none; width: 16px; height: 16px; border-radius: 3px; object-fit: contain; color: var(--texto2); }
svg.pn-icono { width: 13px; height: 13px; margin: 0 1.5px; }
.pn-ficha-x { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--texto2); }
.pn-ficha-x:hover { background: rgba(var(--p), .14); color: var(--texto); }
.pn-mas { flex: none; display: grid; place-items: center; width: 34px; height: 32px; border-radius: 9px; background: rgba(var(--p), .07); color: var(--texto2); }
.pn-mas:hover { background: rgba(var(--p), .13); color: var(--texto); }

.pn-nav { flex: none; display: flex; align-items: center; gap: 4px; height: 42px; padding: 0 10px; border-bottom: 1px solid var(--borde); background: var(--tira); }
.pn-direccion { display: flex; margin: 0 6px; }
.pn-direccion .campo { height: 30px; border-radius: 99px; padding: 0 14px; font-size: var(--f125); }
.pn-solo-movil { display: none; }

.pn-lienzo { flex: 1; min-height: 0; position: relative; background: #000; overflow: hidden; }
.pn-lienzo > .vacio { position: absolute; inset: 0; color: rgba(255, 255, 255, .6); }
.pn-lienzo > .vacio b { color: #fff; }
.pn-marco { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.pn-opciones { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
.pn-carteles { position: absolute; top: 8px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 12px; pointer-events: none; }
.pn-cartel {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; width: min(460px, 100%); padding: 8px 8px 8px 14px; border-radius: 16px;
  background: color-mix(in srgb, var(--flota) 90%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 0 0 1px rgba(var(--p), .1), 0 6px 22px rgba(0, 0, 0, .45); font-size: var(--f12); animation: subir .16s ease-out;
}
.pn-dicho {
  pointer-events: auto; order: 2; max-width: min(460px, 100%); padding: 9px 14px; border-radius: 99px; font-size: var(--f12); font-weight: 500; text-align: center;
  color: var(--texto); background: color-mix(in srgb, var(--flota) 90%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 0 0 1px rgba(var(--p), .1), 0 6px 22px rgba(0, 0, 0, .45); animation: subir .16s ease-out;
}
.pn-cartel b { display: block; font-weight: 600; }
.pn-cartel small { display: block; color: var(--texto2); font-size: var(--f115); line-height: 1.4; }
.pn-cartel.pn-columna { flex-direction: column; align-items: stretch; padding: 12px; }
.pn-cartel-fila { display: flex; align-items: flex-start; gap: 10px; }
.pn-azul { color: var(--azul); }
.pn-rojo { color: var(--rojo); }

/* Tomar el control en el navegador de la Mac: una capa encima de la imagen recibe los clics. */
.pn-capa { position: absolute; inset: 0; cursor: pointer; touch-action: none; outline: none; }
.pn-toque {
  position: absolute; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; pointer-events: none;
  border: 3px solid var(--azul); background: color-mix(in srgb, var(--azul) 25%, transparent); animation: aparecer .1s ease-out;
}
.pn-traer { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); }
.pn-control { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--borde); background: var(--tira); }
.pn-control .campo { height: 36px; border-radius: 10px; }
.pn-tecla { flex: none; min-width: 36px; height: 34px; padding: 0 9px; border-radius: 8px; background: rgba(var(--p), .09); font-size: var(--f12); font-weight: 500; text-align: center; }
.pn-tecla:hover { background: rgba(var(--p), .15); }

/* El teclado del celular hacia el Chrome del VPS. */
.pn-teclado { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 6px 8px; border-top: 1px solid var(--borde); background: var(--tira); }
.pn-teclas { display: flex; gap: 5px; }
.pn-teclas button { flex: 1 1 0; min-width: 0; height: 40px; display: grid; place-items: center; border-radius: 8px; background: rgba(var(--p), .09); font-size: 14px; font-weight: 500; }
.pn-teclas button:active { background: rgba(var(--p), .2); }

/* La hoja para completar un login o pegar un texto. */
.pn-escribir { padding: 6px 18px 18px; }
.pn-escribir header { display: flex; align-items: center; height: 44px; font-size: var(--f14); }
.pn-escribir form { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; }
.pn-escribir h3 { font-size: var(--f115); font-weight: 600; color: var(--texto2); margin-top: 4px; }
.pn-escribir p { font-size: var(--f115); color: var(--texto2); line-height: 1.45; }
.pn-escribir .boton { align-self: flex-start; }
.pn-renglon { display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: var(--f13); }

@media (max-width: 760px) {
  .hoja.pn-hoja { width: 100% !important; height: 100dvh; max-height: 100dvh; border-radius: 0; padding: env(safe-area-inset-top) 0 0; }
  .pn-cabeza { height: 50px; padding: 0 6px 0 4px; }
  .pn-cerrar-movil { display: block; flex: none; height: 40px; padding: 0 12px; font-size: 16px; color: var(--azul); }
  .pn-cerrar { display: none; }
  .pn-titulo { justify-content: center; font-size: 16px; }
  .pn-titulo small { display: none; }
  .pn-modo { height: 36px; font-size: 15px; background: none; }
  /* Como en el iPhone: la barra de atrás, adelante, recargar, ir a, teclado y la llave va abajo. */
  .pn-nav { order: 9; height: calc(46px + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom); border-bottom: 0; border-top: 1px solid var(--borde); gap: 0; }
  .pn-nav .boton-icono { flex: 1 1 0; height: 46px !important; width: auto !important; border-radius: 10px; }
  .pn-direccion { display: none; }
  .pn-solo-movil { display: inline-grid; }
  .pn-teclado { order: 8; }
  .pn-ficha-x { width: 30px; height: 30px; }
  .pn-control { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .pn-control .campo { height: 40px; }
  .pn-control .boton-icono, .pn-tecla { min-width: 40px; height: 40px !important; }
  .pn-escribir { padding-bottom: 4px; }
}

/* MARK: Una miniapp abierta */

.ma-centro { background: var(--tira); }
.ma-marco { flex: 1; min-height: 0; width: 100%; border: 0; display: block; background: transparent; }
.ma-autor { flex: none; max-width: 40%; color: var(--texto3); font-size: var(--f115); }
.ma-versiones { display: flex; flex-direction: column; max-height: min(380px, 70dvh); padding: 12px 16px 14px; }
.ma-versiones header { display: flex; align-items: center; gap: 8px; font-size: var(--f14); min-height: 28px; }
.ma-versiones header b { font-weight: 600; }
.ma-versiones p { font-size: var(--f115); color: var(--texto2); line-height: 1.45; padding: 2px 0 10px; }
.ma-lista { overflow: auto; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.ma-version { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 0; border-bottom: 1px solid var(--borde); }
.ma-version b { display: block; font-size: var(--f125); font-weight: 500; }
.ma-version small { display: block; font-size: var(--f115); color: var(--texto2); }
.ma-cargando { display: grid; place-items: center; padding: 20px 0; }
@media (max-width: 760px) {
  .ma-versiones { max-height: 70dvh; padding: 10px 12px 6px; }
  .ma-version { min-height: 54px; }
}
