/* =====================  v2: interacción  ===================== */
/* progreso de la historia, arriba */
.progreso { position: fixed; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(448px, calc(100% - 32px)); display: flex; gap: 4px; z-index: 40; opacity: 0; transition: opacity .5s; pointer-events: none; }
.progreso.on { opacity: 1; }
.progreso i { flex: 1; height: 3px; border-radius: 2px; background: rgba(127,140,142,.35); overflow: hidden; position: relative; }
.progreso i::after { content: ''; position: absolute; inset: 0; background: var(--oro); transform: scaleX(0); transform-origin: left; transition: transform .8s var(--ease); }
.progreso i.lleno::after { transform: scaleX(1); }
.paso-cabeza { padding-top: max(30px, calc(env(safe-area-inset-top) + 20px)); }

/* deslizar para atender */
.deslizar { position: relative; padding: 18px 26px max(44px, calc(env(safe-area-inset-bottom) + 26px)); }
.deslizar-pista { --p: 0; position: relative; height: 76px; border-radius: 999px; background: rgba(255,255,255,.14); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow: hidden; }
.deslizar-pista::before { content: ''; position: absolute; inset: 0; background: rgba(52,193,122,.35); transform: scaleX(var(--p)); transform-origin: left; }
.deslizar-txt { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 60px; font-size: 17px; color: rgba(255,255,255,.85);
  background: linear-gradient(90deg, rgba(255,255,255,.35) 0%, #fff 50%, rgba(255,255,255,.35) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: brillo-txt 2.4s linear infinite; }
@keyframes brillo-txt { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.deslizar-bola { position: absolute; left: 4px; top: 4px; width: 68px; height: 68px; border-radius: 50%; background: var(--verde); color: #fff; display: grid; place-items: center; touch-action: none; transition: transform .35s var(--ease); box-shadow: 0 4px 18px rgba(0,0,0,.3); }
.deslizar-bola.arrastrando { transition: none; }
.deslizar-bola svg { width: 30px; height: 30px; }
.deslizar-bola:not(.arrastrando) { animation: empuje 2.4s var(--ease) infinite; }
@keyframes empuje { 0%, 60%, 100% { translate: 0 0; } 75% { translate: 14px 0; } }

/* folículo: capas e interacción */
.lienzo .capa { opacity: 0; transition: opacity .35s linear; }
#arte-fantasma { transition-duration: .8s; }
#arte-implante { transition: opacity 1.4s var(--ease); }
.tocables .punto { opacity: .35; }
.tocables .punto.siguiente { opacity: 1; pointer-events: auto; }
.punto.siguiente span { width: 22px; height: 22px; }
.indicacion { min-height: 20px; font-weight: 500; color: var(--tinta); max-width: 32ch; text-align: center; padding: 0 20px; }
.indicacion.pulso { animation: aparece .5s var(--ease); }
@keyframes aparece { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.lienzo.nada { animation: sacude .5s; }
@keyframes sacude { 20% { margin-left: -8px; } 40% { margin-left: 8px; } 60% { margin-left: -5px; } 80% { margin-left: 4px; } }
.mantener { position: relative; display: flex; align-items: center; gap: 14px; height: 72px; padding: 0 26px 0 8px; border-radius: 999px; background: var(--tinta); color: #fff; font-weight: 700; font-size: 16px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; box-shadow: 0 12px 30px rgba(8,38,44,.25); transition: transform .15s; animation: aparece .5s var(--ease); }
.mantener svg { width: 56px; height: 56px; transform: rotate(-90deg); flex: none; }
.mantener .m-fondo { fill: rgba(255,255,255,.08); stroke: rgba(255,255,255,.18); stroke-width: 4; }
.mantener .m-arco { fill: none; stroke: var(--oro); stroke-width: 5; stroke-linecap: round; }
.mantener.activo { transform: scale(.97); }
.mantener.activo svg { filter: drop-shadow(0 0 8px rgba(216,182,106,.8)); }
.destino { position: absolute; width: 15%; aspect-ratio: 1 / 4.4; transform: translate(-50%, -50%) rotate(9deg); border: 2px dashed rgba(18,124,146,0); border-radius: 40px; transition: border-color .3s, background .3s; pointer-events: none; }
.destino.on { border-color: rgba(18,124,146,.55); animation: destino 1.6s ease-in-out infinite; }
.destino.cerca { border-color: var(--oro); background: rgba(216,182,106,.15); animation: none; }
@keyframes destino { 50% { border-color: rgba(18,124,146,.15); } }
.unidad { position: absolute; left: 12px; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: 18px; background: rgba(255,255,255,.94); box-shadow: 0 14px 34px rgba(8,38,44,.22); touch-action: none; cursor: grab; transition: transform .45s var(--ease); }
.unidad.arrastrando { transition: none; cursor: grabbing; }
.unidad.entra { transition: transform .5s var(--ease), opacity .5s; opacity: 0; }
.unidad img { height: 132px; width: auto; filter: drop-shadow(0 10px 18px rgba(8,38,44,.25)); pointer-events: none; }
.unidad span { max-width: 11ch; font-size: 13px; line-height: 1.3; color: var(--tinta); font-weight: 500; }
.unidad.llama img { animation: llama 1.6s ease-in-out infinite; }
@keyframes llama { 50% { transform: translateY(-8px) rotate(4deg); filter: drop-shadow(0 16px 22px rgba(216,182,106,.45)); } }

/* calendario: arrastrar la fecha */
.arrastra { font-size: 13px; color: var(--oro-suave); margin-bottom: 4px; animation: aparece .6s var(--ease); }
.linea-marca { transition: left .25s var(--ease); }
.marca-pin { position: absolute; top: -2px; left: 0; transform: translateX(var(--tx, 0)); padding: 6px 12px; border-radius: 10px; background: var(--oro); color: var(--tinta); font-size: 12.5px; font-weight: 700; white-space: nowrap; touch-action: none; cursor: grab; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.marca-pin::after { content: '\27F7'; margin-left: 6px; opacity: .55; }
.marca-pin.arrastrando { cursor: grabbing; }
.linea-marca .marca-pin span { position: static; padding: 0; background: none; transform: none; color: inherit; font-size: inherit; }
.etapa { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; margin-top: 4px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(216,182,106,.25); transition: border-color .3s, background .3s; }
.etapa[data-k="caida"], .etapa[data-k="reposo"] { border-color: rgba(217,120,122,.55); background: rgba(217,120,122,.08); }
.etapa-pelo { width: 64px; height: 64px; }
.ep-piel { fill: none; stroke: var(--piel); stroke-width: 2; opacity: .6; }
.ep-bulbo { fill: rgba(217,120,122,.35); stroke: var(--rosa); stroke-width: 1.5; }
.ep-pelo { fill: none; stroke: var(--oro); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .5s var(--ease); }
.etapa-cuando { font-size: 12.5px; color: rgba(251,246,243,.6); }
.etapa-que { font-family: var(--serif); font-size: 17px; line-height: 1.35; margin-top: 2px; }
#inicio.pista::-webkit-slider-thumb { animation: pista-thumb 1.2s ease-in-out 2; }
@keyframes pista-thumb { 50% { transform: translateX(40px); } }
.fases-lista i.fase { display: block; position: static; width: 12px !important; height: 12px !important; border-radius: 3px; transform: translateY(2px); top: auto; }

/* chat */
.aviso-push { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 20; display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 20px;
  background: rgba(250,248,246,.88); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); box-shadow: 0 16px 40px rgba(8,38,44,.25); transform: translateY(-140%); transition: transform .6s var(--ease); }
.aviso-push.on { transform: none; }
.aviso-push img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.ap-app { font-size: 11.5px; color: var(--texto-2); }
.ap-tit { font-weight: 700; font-size: 15px; }
.ap-txt { font-size: 14px; line-height: 1.3; }
.chat-dia { align-self: center; font-size: 12px; color: var(--texto-2); background: rgba(8,38,44,.06); padding: 4px 10px; border-radius: 8px; }
.burbuja .meta { display: inline-block; margin-left: 8px; font-size: 11px; opacity: .7; vertical-align: bottom; }
.burbuja.paciente .tilde { font-style: normal; letter-spacing: -3px; color: rgba(255,255,255,.6); transition: color .3s; }
.burbuja.paciente.leido .tilde { color: var(--agua); }
.grabando-burbuja { display: flex; align-items: center; gap: 3px; height: 22px; }
.grabando-burbuja i { width: 10px; height: 10px; border-radius: 50%; background: var(--rojo); margin-right: 8px; animation: titila 1s infinite; }
.grabando-burbuja b { width: 3px; height: 8px; border-radius: 2px; background: var(--teal); animation: barra .8s ease-in-out infinite; }
.grabando-burbuja b:nth-child(3) { animation-delay: .1s; } .grabando-burbuja b:nth-child(4) { animation-delay: .2s; } .grabando-burbuja b:nth-child(5) { animation-delay: .3s; } .grabando-burbuja b:nth-child(6) { animation-delay: .4s; }
@keyframes barra { 50% { height: 20px; } }
.nota { grid-template-columns: 46px 40px 1fr; width: min(320px, 86vw); }
.nota-foto { position: relative; width: 46px; height: 46px; }
.nota-foto img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.nota-mic { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; border: 2px solid #fff; }
.nota-mic svg { width: 11px; height: 11px; }
.burbuja.escuchada .nota-mic { background: var(--agua); }
.nota-play { width: 40px; height: 40px; background: none; color: var(--tinta); }
.nota-play svg { width: 26px; height: 26px; }
.nota-meta { grid-column: 3; align-items: center; gap: 8px; }
.nota-meta .meta { margin-left: auto; }
.burbuja.sonando { box-shadow: 0 0 0 2px rgba(18,124,146,.25), 0 1px 2px rgba(8,38,44,.08); }
.tv { position: relative; }
.tv-play { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; background: linear-gradient(180deg, rgba(8,38,44,.05), rgba(8,38,44,.55)); border-radius: 13px; color: #fff; }
.tv-play span { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--tinta); display: grid; place-items: center; }
.tv-play svg { width: 26px; height: 26px; margin-left: 4px; }
.tv-play em { font-style: normal; font-weight: 700; font-size: 15px; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.tv-play[hidden] { display: none; }
.chat-dudas { flex-wrap: wrap; overflow: visible; padding: 10px 12px 2px; gap: 7px; }
.chat-dudas button { max-width: none; padding: 9px 13px; font-size: 14px; border-radius: 999px; animation: aparece .4s var(--ease) both; }
.chat-dudas button.vista::before { content: '\2713  '; color: var(--teal); }
.chat-dudas button.sugerida { background: var(--teal); color: #fff; border-color: var(--teal); box-shadow: 0 6px 16px rgba(18,124,146,.3); }
.chat-dudas button:disabled { opacity: .4; }

/* plan */
#t-preguntas li { animation: aparece .5s var(--ease) both; }
.hoja { position: absolute; inset: 0; z-index: 30; display: flex; align-items: flex-end; background: rgba(8,38,44,.35); animation: aparece .3s; }
.hoja-caja { width: 100%; padding: 22px 18px max(18px, env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: #fff; display: grid; gap: 10px; box-shadow: 0 -10px 40px rgba(8,38,44,.2); animation: sube .4s var(--ease); }
@keyframes sube { from { transform: translateY(100%); } to { transform: none; } }
.hoja-tit { font-family: var(--serif); font-size: 22px; margin-bottom: 4px; }
.hoja-op { display: grid; place-items: center; height: 52px; border-radius: 14px; background: var(--hueso); color: var(--tinta); font-weight: 700; text-decoration: none; border: 1px solid rgba(8,38,44,.1); }
.hoja-cerrar { height: 46px; color: var(--texto-2); }

/* calendario: cabecera y subtitulos fijos mientras se recorre */
.calendario .paso-cabeza { position: sticky; top: 0; z-index: 6; padding-bottom: 12px; background: linear-gradient(var(--tinta) 78%, rgba(8,38,44,0)); }
.calendario .subtitulos { position: sticky; bottom: 0; z-index: 6; margin-top: auto; padding: 30px 24px max(14px, env(safe-area-inset-bottom)); min-height: 0; background: linear-gradient(rgba(8,38,44,0), var(--tinta) 38%); }
.calendario .subtitulos:empty { padding: 0; }

/* dudas: dos filas que se deslizan de costado, para que el chat respire */
.chat-dudas { display: grid; grid-template-rows: auto auto; grid-auto-flow: column; grid-auto-columns: max-content; gap: 7px; overflow-x: auto; overflow-y: hidden; padding: 10px 14px 4px; scroll-snap-type: x proximity; flex-wrap: nowrap;
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.chat-dudas button { scroll-snap-align: start; white-space: nowrap; }
