/* Charla · pantallas de la app (dirección A · papel) */
body { overscroll-behavior-y: none; }
@media (min-width: 720px) {
  body { background: var(--papel-2); }
  #app { background: var(--papel); box-shadow: 0 30px 80px -40px #1F1A1766, 0 0 0 1px var(--linea); }
  .barra { border-left: 1px solid var(--linea); border-right: 1px solid var(--linea); }
}
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; }
.pantalla { min-height: 100dvh; padding: calc(env(safe-area-inset-top) + 22px) 22px calc(env(safe-area-inset-bottom) + 28px); display: flex; flex-direction: column; gap: 18px; animation: entra .38s var(--curva) both; }
.pantalla.con-barra { padding-bottom: calc(env(safe-area-inset-bottom) + 100px); }
.icono-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--blanco); display: grid; place-items: center; font-size: 18px; text-decoration: none; box-shadow: var(--sombra); flex: none; }
.nota { color: var(--tinta-2); font-size: var(--t-14); }
.pequeno { font-size: var(--t-14); }
.ancho { width: 100%; }
.hola { font-size: var(--t-41); font-weight: 800; }
.seccion-tit { font-size: var(--t-21); font-weight: 700; margin-top: 10px; }

/* ---------- Avisos ---------- */
.avisos { position: fixed; top: calc(env(safe-area-inset-top) + 12px); left: 50%; translate: -50%; z-index: 60; display: grid; gap: 8px; width: min(440px, 92vw); }
.aviso { background: var(--tinta); color: var(--papel); padding: 12px 16px; border-radius: 16px; font-size: var(--t-14); animation: entra .3s var(--curva) both; }
.sin-conexion { position: fixed; top: 0; left: 0; right: 0; z-index: 70; background: var(--sub); color: var(--tinta); text-align: center; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; font-size: var(--t-14); font-weight: 600; }

/* ---------- Bienvenida ---------- */
.bv-cabecera { display: flex; align-items: center; gap: 12px; }
.hilo { flex: 1; height: 4px; background: var(--papel-2); border-radius: 4px; overflow: hidden; }
.hilo span { display: block; height: 100%; width: 0; background: var(--teja); border-radius: 4px; transition: width .5s var(--curva); }
.bv-paso { flex: 1; display: flex; flex-direction: column; gap: 18px; }
.bv-paso h1 { font-size: var(--t-33); font-weight: 800; margin-top: 8px; }
.bv-paso .apoyo { color: var(--tinta-2); }
.bv-reaccion { display: flex; gap: 12px; align-items: center; background: var(--blanco); border-radius: var(--radio); padding: 10px 14px 10px 10px; box-shadow: var(--sombra); font-size: var(--t-14); animation: entra .4s var(--curva) both; }
.bv-reaccion .cara { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex: none; background: var(--papel-2); }
.bv-reaccion .cara svg { width: 60px; margin: -2px 0 0 -7px; }
.opciones { display: grid; gap: 10px; }
.opcion { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 2px solid transparent; background: var(--blanco); border-radius: var(--radio); padding: 15px 16px; box-shadow: var(--sombra); min-height: 58px; transition: border-color .2s, transform .18s var(--muelle); }
.opcion:active { transform: scale(.98); }
.opcion[aria-pressed="true"], .opcion[aria-checked="true"] { border-color: var(--teja); }
.opcion .emoji { font-size: 22px; width: 28px; text-align: center; }
.opcion[role="checkbox"]::after { content: ""; margin-left: auto; width: 22px; height: 22px; border-radius: 7px; border: 2px solid #1F1A1759; flex: none; display: grid; place-items: center; font-size: 14px; color: #fff; }
.opcion[role="checkbox"][aria-checked="true"]::after { content: "✓"; background: var(--teja); border-color: var(--teja); }
.opciones.dos .opcion { padding: 12px; gap: 8px; }
.opcion small { display: block; color: var(--tinta-2); font-size: var(--t-14); }
.opciones.dos { grid-template-columns: 1fr 1fr; }
.opcion-tutor { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; }
.opcion-tutor .retrato { border-radius: 16px; height: 120px; overflow: hidden; display: grid; place-items: end center; }
.opcion-tutor .retrato svg { width: 110px; }
.opcion-tutor b { font-family: var(--titular); font-size: var(--t-21); }
.bv-siguiente { margin-top: auto; position: sticky; bottom: calc(env(safe-area-inset-bottom) + 12px); z-index: 2; }
.bv-precio { display: grid; gap: 2px; text-align: center; font-size: var(--t-14); color: var(--tinta-2); border-top: 1px solid var(--linea); padding-top: 12px; }

/* ---------- Formularios ---------- */
.formulario h1 { font-size: var(--t-33); font-weight: 800; }
.campos { display: grid; gap: 14px; }
.campos label { display: grid; gap: 6px; font-weight: 600; font-size: var(--t-14); }
.campos input { font: inherit; font-weight: 400; font-size: var(--t-17); padding: 14px 16px; border-radius: 16px; border: 1.5px solid #1F1A1759; background: var(--blanco); color: var(--tinta); min-height: 52px; }
.campos input:focus { outline: none; border-color: var(--teja); box-shadow: 0 0 0 4px var(--teja-suave); }
.campos input[aria-invalid="true"] { border-color: var(--teja); }
.error-form { color: var(--teja-osc); font-size: var(--t-14); min-height: 1.2em; }

/* ---------- Inicio ---------- */
.ini-cabecera .pastilla { white-space: nowrap; flex: none; }
.ini-cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 18px; }
.dia { position: relative; display: block; width: 100%; text-align: left; border: 0; background: var(--teja); color: #fff; border-radius: var(--radio-g); padding: 22px 22px 0; min-height: 330px; overflow: hidden; box-shadow: 0 24px 40px -26px var(--teja); transition: transform .2s var(--muelle); }
.dia:active { transform: scale(.985); }
.dia-meta { display: block; font-size: var(--t-14); opacity: .85; }
.dia-titulo { display: block; font-size: var(--t-33); font-weight: 800; margin-top: 8px; max-width: 62%; position: relative; z-index: 1; text-wrap: balance; }
.dia-meta, .dia-btn { z-index: 1; }
.dia-tutor { position: absolute; right: -18px; bottom: -10px; width: 190px; }
.dia-btn { position: absolute; left: 22px; bottom: 22px; }
.fila-tarjeta { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--blanco); border-radius: var(--radio); padding: 16px 18px; text-decoration: none; box-shadow: var(--sombra); }
.nota-limite { background: var(--papel-2); border-radius: 16px; padding: 12px 14px; font-size: var(--t-14); }
.escenarios { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.escenario { border: 0; background: var(--blanco); border-radius: 18px; padding: 14px; text-align: left; box-shadow: var(--sombra); min-height: 84px; display: flex; flex-direction: column; justify-content: space-between; transition: transform .18s var(--muelle); }
.escenario:active { transform: scale(.97); }
.escenario b { font-family: var(--titular); font-size: var(--t-17); line-height: 1.1; }
.escenario span { font-size: 22px; }

/* ---------- Barra inferior ---------- */
.barra { position: fixed; bottom: 0; left: 50%; translate: -50%; width: min(480px, 100%); display: flex; justify-content: space-around; background: var(--blanco); padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px); border-top: 1px solid var(--linea); z-index: 20; }
.barra a { display: grid; place-items: center; gap: 2px; text-decoration: none; color: var(--tinta-2); font-size: 12px; min-width: 72px; min-height: 48px; }
.barra a span { font-size: 18px; }
.barra a[aria-current="page"] { color: var(--teja); font-weight: 600; }

/* ---------- Conversación ---------- */
.charla { gap: 10px; padding-bottom: calc(env(safe-area-inset-bottom) + 16px); }
.ch-arriba { display: flex; justify-content: space-between; align-items: center; }
.ch-escena { flex: 1; min-height: 220px; display: grid; place-items: center; position: relative; }
.ch-fondo { position: absolute; width: min(64vw, 250px); aspect-ratio: 1; border-radius: 50%; background: #EBD9C4; transition: transform .6s var(--curva); }
.ch-tutor { width: min(56vw, 220px); position: relative; transition: transform .5s var(--curva); }
.ch-pensando { position: absolute; top: 14%; right: 14%; width: 70px; background: var(--blanco); border-radius: 18px; padding: 10px 8px; box-shadow: var(--sombra); }
.ch-pensando path { stroke-dasharray: 120; stroke-dashoffset: 120; animation: garabato 1.4s var(--curva) infinite; }
@keyframes garabato { to { stroke-dashoffset: 0; } }
/* estados del tutor */
.tutor-svg .t-boca-abierta { opacity: 0; transition: opacity .08s; }
.tutor-svg .t-cabeza { transform-origin: 100px 120px; transition: transform .45s var(--curva); }
.tutor-svg .t-ojos { transform-origin: 100px 94px; animation: parpadeo 5s infinite; }
@keyframes parpadeo { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.charla[data-estado="escucha"] .t-cabeza { transform: rotate(-6deg); }
.charla[data-estado="piensa"] .t-cabeza { transform: translateY(-3px) rotate(3deg); }
.charla[data-estado="piensa"] .t-ojos { transform: translateY(-4px); animation: none; }
.charla[data-estado="habla"] .ch-fondo { transform: scale(1.04); }
.charla.boca-abierta .t-boca-abierta { opacity: 1; }
.charla.boca-abierta .t-boca-sonrisa { opacity: 0; }

.ch-texto { min-height: 120px; }
.ch-subs { font-size: 1.375rem; line-height: 1.35; }
.ch-subs.grande { font-size: 1.75rem; }
.ch-subs .w { color: #7A7068; transition: color .12s; }
.ch-subs .w.dicha { color: var(--tinta); }
.ch-traduccion { color: var(--tinta-2); font-size: var(--t-14); margin-top: 6px; font-style: italic; }
.ch-tuya { margin-top: 12px; font-size: 15px; color: var(--tinta-2); background: var(--blanco); border-radius: 16px; padding: 10px 12px; box-shadow: var(--sombra); }
.ch-tuya button { background: none; border: 0; padding: 0; text-align: left; }
.ch-tuya .error { background-image: linear-gradient(var(--sub), var(--sub)); background-repeat: no-repeat; background-position: 0 85%; background-size: 100% 45%; animation: subraya-media .4s var(--curva) both; }
@keyframes subraya-media { from { background-size: 0% 45%; } to { background-size: 100% 45%; } }
.ch-tuya .mejor { color: var(--tinta); font-weight: 600; }
.ch-tuya .ver-por-que { display: block; margin-top: 4px; font-size: 13px; color: var(--teja-osc); font-weight: 600; }
.ch-estado { text-align: center; color: var(--tinta-2); font-size: var(--t-14); min-height: 1.4em; }
.ch-controles { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.comodin { border: 0; background: var(--blanco); border-radius: 999px; padding: 11px 13px; font-size: 13px; box-shadow: var(--sombra); min-height: 44px; max-width: 30%; line-height: 1.15; }
.micro { position: relative; width: 78px; height: 78px; border-radius: 50%; border: 0; background: var(--teja); display: grid; place-items: center; transition: transform .18s var(--muelle), background-color .2s; flex: none; }
.micro:active { transform: scale(.94); }
.micro-anillo { position: absolute; inset: -10px; border-radius: 50%; background: var(--teja-suave); transform: scale(var(--nivel, 1)); transition: transform .08s linear; pointer-events: none; }
.micro[aria-pressed="true"] { background: var(--teja-osc); }
.micro[disabled] { background: var(--tinta-3); }
.ch-escribir { display: flex; gap: 8px; }
.ch-escribir input { flex: 1; font: inherit; padding: 12px 14px; border-radius: 999px; border: 1.5px solid #1F1A1759; background: var(--blanco); min-height: 48px; }
.ch-escribir input:focus { outline: none; border-color: var(--teja); }
.ch-escribir .btn { padding: .7em 1.1em; }

/* ---------- Hoja inferior ---------- */
.hoja-velo { position: fixed; inset: 0; background: #1F1A1755; z-index: 40; }
.hoja { position: fixed; left: 50%; bottom: 0; translate: -50%; width: min(480px, 100%); max-height: 80dvh; overflow: auto; background: var(--papel); border-radius: 28px 28px 0 0; padding: 10px 22px calc(env(safe-area-inset-bottom) + 24px); z-index: 50; animation: sube .32s var(--curva) both; }
@keyframes sube { from { transform: translateY(100%); } to { transform: none; } }
.hoja-cerrar { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; font-size: 15px; }
.hoja-asa { width: 44px; height: 5px; border-radius: 5px; background: var(--linea); margin: 0 auto 14px; }
.hoja h2 { font-size: var(--t-26); font-weight: 800; margin-bottom: 12px; }
.hoja .sugerencia { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: var(--blanco); border-radius: 16px; padding: 14px; margin-bottom: 8px; box-shadow: var(--sombra); font-size: var(--t-17); }

/* ---------- Correcciones (resumen, cuaderno, hoja) ---------- */
.correccion { background: var(--blanco); border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); margin-bottom: 10px; display: grid; gap: 6px; }
.correccion .dijiste { color: var(--tinta-2); text-decoration: line-through; text-decoration-color: var(--teja); text-decoration-thickness: 2px; }
.correccion .correcto { font-family: var(--titular); font-weight: 700; font-size: var(--t-21); }
.correccion .correcto mark { padding: 0; }
.correccion .porque { font-size: var(--t-14); color: var(--tinta-2); }
.correccion .acciones { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.mini { border: 0; background: var(--papel-2); border-radius: 999px; padding: 8px 12px; font-size: 13px; min-height: 40px; }
.etiqueta { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--tinta-2); }
.vacio { text-align: center; color: var(--tinta-2); padding: 40px 10px; }

/* ---------- Resumen ---------- */
.res-cabecera { display: flex; gap: 14px; align-items: flex-end; margin-top: 18px; }
.res-tutor { width: 96px; flex: none; }
.res-titular { font-size: var(--t-33); font-weight: 800; }
.res-titular b { background: linear-gradient(transparent 55%, var(--sub) 55%); -webkit-box-decoration-break: clone; box-decoration-break: clone; white-space: nowrap; }
.palabra { display: flex; justify-content: space-between; gap: 10px; background: var(--blanco); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--sombra); }
.palabra b { font-family: var(--titular); }

/* ---------- Yo ---------- */
.datos-rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dato { background: var(--blanco); border-radius: 18px; padding: 14px; box-shadow: var(--sombra); }
.dato b { display: block; font-family: var(--titular); font-size: var(--t-33); font-weight: 800; line-height: 1; }
.dato span { font-size: var(--t-14); color: var(--tinta-2); }
.bloque { padding: 18px; display: grid; gap: 12px; }
.bloque-tit { font-size: var(--t-17); font-weight: 700; }
.ticket { display: grid; gap: 6px; }
.ticket .importe { font-family: var(--titular); font-size: var(--t-33); font-weight: 800; }
.tutores-fila { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.tutor-chip { border: 2px solid transparent; background: var(--papel); border-radius: 18px; padding: 6px 6px 8px; width: 84px; flex: none; display: grid; gap: 4px; justify-items: center; font-size: 13px; }
.tutor-chip .retrato { width: 70px; height: 70px; border-radius: 50%; overflow: hidden; display: grid; place-items: end center; }
.tutor-chip .retrato svg { width: 74px; }
.tutor-chip[aria-checked="true"] { border-color: var(--teja); }
.opciones-fila { display: flex; gap: 8px; flex-wrap: wrap; }
.opciones-fila .mini[aria-checked="true"] { background: var(--teja); color: #fff; }
.acciones-cuenta { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 8px; }
