/* App del miembro: una columna tipo móvil con barra de pestañas abajo. */
.app { min-height: 100dvh; }
.app-main { width: min(100%, 620px); margin: 0 auto; padding: calc(18px + var(--seguro-arriba)) 18px calc(110px + var(--seguro-abajo)); display: grid; gap: 18px; align-content: start; }
.cargando { display: grid; place-items: center; min-height: 60dvh; color: var(--tenue); }
.cargando svg { width: 46px; height: 46px; color: var(--texto); animation: late 1.4s ease-in-out infinite; }
@keyframes late { 50% { opacity: .35; transform: scale(.94); } }

/* Cabecera de pantalla */
.cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-top: 6px; }
.cab h1 { font: 500 clamp(30px, 8vw, 40px)/1.05 var(--sans); letter-spacing: -.035em; margin-top: 10px; }
.cab h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--brasa-2); }
.cab-acciones { display: flex; gap: 8px; align-items: center; flex: none; }
.icono-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--linea); background: var(--sup); display: grid; place-items: center; color: var(--texto); }
.icono-btn svg { width: 20px; height: 20px; }
.icono-btn .punto { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--brasa); color: #160e07; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.racha { display: inline-flex; align-items: center; gap: 5px; height: 44px; padding: 0 14px; border-radius: 99px; background: var(--brasa-fondo); color: var(--brasa-2); font-weight: 750; font-variant-numeric: tabular-nums; }
.racha svg { width: 18px; height: 18px; }
.racha.cero { background: var(--sup); color: var(--tenue); border: 1px solid var(--linea); }

/* Selector de día */
.dias-sel { display: inline-flex; padding: 4px; border-radius: 99px; background: var(--sup); border: 1px solid var(--linea); justify-self: start; }
.dias-sel button { border: 0; background: transparent; color: var(--suave); height: 32px; padding: 0 14px; border-radius: 99px; font-size: 13.5px; font-weight: 600; }
.dias-sel button[aria-pressed=true] { background: var(--sup-3); color: var(--texto); }

/* Progreso del día */
.progreso-dia { display: grid; gap: 10px; }
.progreso-dia header { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--suave); }
.progreso-dia header b { color: var(--texto); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.barra.gorda { height: 10px; }

/* Entreno de hoy (arriba en Hoy, con los ejercicios a la vista) */
.entreno-hoy { display: grid; gap: 14px; padding: 18px; border-radius: 18px; border: 1px solid rgba(232, 130, 58, .45); background: radial-gradient(130% 100% at 100% 0%, rgba(232, 130, 58, .14), transparent 60%), var(--sup); }
.entreno-hoy.descanso { border-color: var(--linea); background: var(--sup); }
.entreno-hoy header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.entreno-hoy h2 { font: 600 22px/1.15 var(--sans); letter-spacing: -.02em; margin-top: 8px; }
.entreno-hoy .boton { flex: none; }
.ejercicios-hoy { list-style: none; margin: 0; padding: 0; display: grid; counter-reset: ej; }
.ejercicios-hoy li { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--linea); counter-increment: ej; font-size: 15px; }
.ejercicios-hoy li::before { content: counter(ej, decimal-leading-zero); font-size: 11.5px; font-weight: 700; color: var(--brasa); letter-spacing: .06em; }
.ejercicios-hoy span { flex: 1; }
.ejercicios-hoy b { font-weight: 600; color: var(--suave); white-space: nowrap; font-variant-numeric: tabular-nums; }
.nota-coach { font-size: 14px; color: var(--suave); padding: 10px 12px; border-radius: 10px; background: var(--brasa-fondo); }

/* Hábitos */
.habitos { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.habito { width: 100%; display: flex; gap: 14px; align-items: center; text-align: left; padding: 16px; border-radius: 16px; border: 1px solid var(--linea); background: var(--sup); transition: background .2s, border-color .2s, transform .1s; }
.habito:active { transform: scale(.99); }
.habito .caja { flex: none; width: 30px; height: 30px; border-radius: 10px; border: 2px solid var(--linea-2); display: grid; place-items: center; transition: .2s; }
.habito .caja svg { width: 18px; height: 18px; color: #160e07; opacity: 0; transform: scale(.6); transition: .2s; }
.habito .que { flex: 1; display: grid; gap: 3px; min-width: 0; }
.habito .que b { font-weight: 600; font-size: 16px; }
.habito .que small { color: var(--tenue); font-size: 13px; line-height: 1.35; }
.habito .pilar { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--tenue); font-weight: 700; }
.habito[aria-pressed=true] { background: linear-gradient(90deg, rgba(232, 130, 58, .1), var(--sup) 70%); border-color: rgba(232, 130, 58, .35); }
.habito[aria-pressed=true] .caja { background: var(--brasa); border-color: var(--brasa); }
.habito[aria-pressed=true] .caja svg { opacity: 1; transform: none; }
.habito[aria-pressed=true] .que b { color: var(--suave); }
[data-perfecto]:empty { display: none; }
.perfecto { text-align: center; padding: 18px; border-radius: 16px; background: var(--brasa-fondo); color: var(--brasa-2); font-family: var(--serif); font-style: italic; font-size: 22px; }

/* Tarjetas de acción */
.accion { display: flex; gap: 14px; align-items: center; width: 100%; padding: 16px; border-radius: 16px; border: 1px solid var(--linea); background: var(--sup); text-align: left; text-decoration: none; color: inherit; }
.accion:hover { border-color: var(--linea-2); }
.accion > svg:last-child { width: 18px; height: 18px; color: var(--tenue); flex: none; }
.accion .ic { flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--sup-3); color: var(--brasa-2); }
.accion .ic svg { width: 22px; height: 22px; }
.accion .que { flex: 1; display: grid; gap: 2px; min-width: 0; }
.accion .que small { color: var(--tenue); font-size: 13.5px; }
.accion.brasa { background: var(--brasa-fondo); border-color: rgba(232, 130, 58, .3); }
.mensaje-coach { display: grid; gap: 8px; padding: 18px; border-radius: 16px; background: var(--brasa-fondo); border: 1px solid rgba(232, 130, 58, .3); text-align: left; width: 100%; color: inherit; }
.mensaje-coach p { font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.3; }
.mensaje-coach .rotulo { color: var(--brasa-2); }

.seccion { display: grid; gap: 12px; margin-top: 8px; }
.seccion > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.seccion > header h2 { font: 600 18px/1.2 var(--sans); letter-spacing: -.02em; }
.identidad-dia { font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.3; padding: 4px 0 4px 16px; border-left: 2px solid var(--brasa); color: var(--suave); }

/* Retos */
.reto { display: grid; gap: 12px; padding: 18px; border-radius: 16px; border: 1px solid var(--linea); background: var(--sup); }
.reto header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.reto h3 { font-size: 17px; }
.reto p { color: var(--suave); font-size: 14.5px; }
.reto .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.reto.recomendado { border-color: rgba(232, 130, 58, .45); background: radial-gradient(140% 100% at 100% 0%, rgba(232, 130, 58, .12), transparent 60%), var(--sup); }
.reto.hecho { opacity: .75; }
.cuadros { display: grid; grid-template-columns: repeat(auto-fill, minmax(14px, 1fr)); gap: 4px; }
.cuadros i { aspect-ratio: 1; border-radius: 4px; background: var(--sup-3); }
.cuadros i.h { background: var(--brasa); }
.cuadros i.hoy { box-shadow: inset 0 0 0 1.5px var(--brasa); }
.alerta { font-size: 13.5px; padding: 10px 12px; border-radius: 10px; background: rgba(232, 104, 79, .12); color: #f2a191; }
.fila-acciones { display: flex; gap: 8px; align-items: center; justify-content: space-between; }

/* Comunidad */
.filtros { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
.filtros::-webkit-scrollbar { display: none; }
.filtros button { flex: none; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--linea); background: var(--sup); color: var(--suave); font-size: 14px; font-weight: 600; }
.filtros button[aria-pressed=true] { background: var(--texto); color: #15110c; border-color: var(--texto); }
.componer { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px dashed var(--linea-2); background: transparent; color: var(--suave); text-align: left; font-size: 15px; }
.componer svg { width: 20px; height: 20px; color: var(--brasa); }
.post { display: grid; gap: 12px; padding: 18px; border-radius: 16px; border: 1px solid var(--linea); background: var(--sup); }
.post.fijada { border-color: rgba(232, 130, 58, .45); }
.post.logro { padding: 14px 16px; background: transparent; border-style: dashed; }
.post-cab { display: flex; gap: 12px; align-items: center; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--sup-3); color: var(--texto); font-weight: 700; font-size: 15px; }
.avatar.coach { background: var(--brasa); color: #160e07; }
.post-cab .quien { flex: 1; min-width: 0; display: grid; gap: 1px; }
.post-cab .quien b { font-size: 15px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.post-cab .quien small { color: var(--tenue); font-size: 12.5px; }
.post .texto { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.5; }
.post.logro .texto { color: var(--suave); font-size: 14.5px; }
.post-acc { display: flex; gap: 6px; align-items: center; }
.post-acc button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--linea); background: transparent; color: var(--suave); font-size: 13.5px; font-weight: 600; }
.post-acc button svg { width: 17px; height: 17px; }
.post-acc button[aria-pressed=true] { color: var(--brasa-2); border-color: rgba(232, 130, 58, .45); background: var(--brasa-fondo); }
.post-acc .mas { margin-left: auto; border: 0; padding: 0 8px; }
.comentario { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.comentario .avatar { width: 32px; height: 32px; font-size: 13px; }
.comentario div { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 14.5px; }
.comentario b { font-size: 13.5px; }
.comentario p { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Rango y recompensas */
.rango-caja { padding: 24px; border-radius: 22px; background: radial-gradient(130% 90% at 100% 0%, rgba(232, 130, 58, .2), transparent 60%), var(--sup); border: 1px solid var(--linea-2); display: grid; gap: 14px; }
.rango-caja .nombre { font-family: var(--serif); font-style: italic; font-size: 52px; line-height: 1; color: var(--texto); }
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.cifra-caja { padding: 16px; border-radius: 14px; background: var(--sup); border: 1px solid var(--linea); display: grid; gap: 4px; }
.cifra-caja b { font-size: 26px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cifra-caja span { font-size: 12.5px; color: var(--tenue); }
.ranking { list-style: none; margin: 0; padding: 0; display: grid; border-radius: 16px; border: 1px solid var(--linea); overflow: hidden; }
.ranking li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--sup); border-bottom: 1px solid var(--linea); }
.ranking li:last-child { border-bottom: 0; }
.ranking li.yo { background: var(--brasa-fondo); }
.ranking .pos { width: 26px; font-weight: 700; color: var(--tenue); font-variant-numeric: tabular-nums; }
.ranking li:nth-child(-n+3) .pos { color: var(--brasa-2); }
.ranking .q { flex: 1; min-width: 0; display: grid; }
.ranking .q small { color: var(--tenue); font-size: 12.5px; }
.ranking .pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.recompensa { display: grid; gap: 10px; padding: 18px; border-radius: 16px; border: 1px solid var(--linea); background: var(--sup); }
.recompensa header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.recompensa p { color: var(--suave); font-size: 14.5px; }
.coste { font-weight: 750; color: var(--brasa-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Perfil */
.perfil-cab { display: flex; gap: 16px; align-items: center; }
.perfil-cab .avatar { width: 64px; height: 64px; font-size: 24px; }
.calor { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; max-width: 340px; }
.calor i { aspect-ratio: 1; border-radius: 5px; background: var(--sup-2); }
.calor i.p { background: rgba(232, 130, 58, .35); }
.calor i.c { background: rgba(232, 130, 58, .7); }
.calor i.t { background: var(--brasa); }
.calor i.f { visibility: hidden; }
.calor-dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; max-width: 340px; font-size: 11px; color: var(--tenue); text-align: center; }
.insignias { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.insignia { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 14px 8px; border-radius: 14px; background: var(--sup); border: 1px solid var(--linea); font-size: 12.5px; }
.insignia .ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--brasa-fondo); color: var(--brasa-2); }
.insignia .ic svg { width: 22px; height: 22px; }
.insignia.no { opacity: .38; }
.insignia.no .ic { background: var(--sup-3); color: var(--tenue); }
.invita { display: grid; gap: 12px; padding: 20px; border-radius: 18px; background: var(--sup); border: 1px solid var(--linea-2); }
.enlace-copia { display: flex; gap: 8px; }
.enlace-copia .entrada { font-size: 14px; min-height: 44px; }
.lista-ajustes { display: grid; border-radius: 16px; border: 1px solid var(--linea); overflow: hidden; }
.lista-ajustes > * { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 16px; background: var(--sup); border: 0; border-bottom: 1px solid var(--linea); text-align: left; color: inherit; text-decoration: none; font-size: 15px; width: 100%; }
.lista-ajustes > *:last-child { border-bottom: 0; }
.lista-ajustes svg { width: 18px; height: 18px; color: var(--tenue); }
.lista-ajustes .peligro { color: var(--peligro); }

/* Barra de pestañas */
.pestanas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; padding: 8px 10px calc(8px + var(--seguro-abajo)); background: rgba(14, 12, 10, .86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--linea); }
.pestanas nav { display: grid; grid-template-columns: repeat(5, 1fr); width: min(100%, 560px); }
.pestanas a { display: grid; justify-items: center; gap: 4px; padding: 6px 0; text-decoration: none; color: var(--tenue); font-size: 11px; font-weight: 600; letter-spacing: .01em; position: relative; }
.pestanas a svg { width: 24px; height: 24px; }
.pestanas a[aria-current=page] { color: var(--texto); }
.pestanas a[aria-current=page]::after { content: ''; position: absolute; top: -9px; width: 22px; height: 2px; border-radius: 2px; background: var(--brasa); }

/* Hojas (paneles que suben desde abajo) */
.velo { position: fixed; inset: 0; z-index: 60; background: rgba(5, 4, 3, .62); backdrop-filter: blur(3px); animation: aparece .2s; }
@keyframes aparece { from { opacity: 0; } }
.hoja { position: fixed; z-index: 61; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 620px); max-height: min(92dvh, 900px); display: flex; flex-direction: column; background: var(--fondo); border: 1px solid var(--linea-2); border-bottom: 0; border-radius: 24px 24px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); animation: sube .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes sube { from { transform: translate(-50%, 40px); opacity: 0; } }
.hoja-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 12px; }
.hoja-cab h2 { font: 600 19px/1.2 var(--sans); letter-spacing: -.02em; }
.hoja-cuerpo { overflow-y: auto; padding: 4px 18px calc(22px + var(--seguro-abajo)); display: grid; gap: 16px; align-content: start; overscroll-behavior: contain; }
.hoja-pie { padding: 12px 18px calc(14px + var(--seguro-abajo)); border-top: 1px solid var(--linea); display: flex; gap: 8px; align-items: flex-end; }
.hoja-pie .entrada { min-height: 46px; }
.hoja-pie textarea.entrada { min-height: 46px; max-height: 140px; }
.hoja .carta { font-size: 17px; line-height: 1.65; display: grid; gap: 14px; color: var(--suave); }
.hoja .carta p:first-child { color: var(--texto); font-weight: 600; }
.hoja .carta p:last-child { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--texto); }
.ejercicios { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: ej; }
.ejercicios li { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--sup); border: 1px solid var(--linea); counter-increment: ej; }
.ejercicios li::before { content: counter(ej, decimal-leading-zero); font-size: 12px; font-weight: 700; color: var(--brasa); letter-spacing: .06em; }
.ejercicios b { flex: 1; font-weight: 550; }
.ejercicios span { color: var(--suave); font-variant-numeric: tabular-nums; white-space: nowrap; }
.notas { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; color: var(--suave); font-size: 14.5px; }
.notas li { padding-left: 16px; position: relative; }
.notas li::before { content: ''; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--brasa); }
.burbujas { display: grid; gap: 10px; }
.burbuja { max-width: 84%; padding: 12px 14px; border-radius: 18px; background: var(--sup-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.45; }
.burbuja.yo { justify-self: end; background: var(--brasa); color: #160e07; border-bottom-right-radius: 6px; }
.burbuja.coach { border-bottom-left-radius: 6px; }
.burbuja small { display: block; margin-top: 4px; font-size: 11px; opacity: .65; }
.tipos { display: flex; gap: 8px; flex-wrap: wrap; }
.tipos label { position: relative; }
.tipos input { position: absolute; opacity: 0; }
.tipos span { display: inline-flex; height: 36px; align-items: center; padding: 0 14px; border-radius: 99px; border: 1px solid var(--linea-2); color: var(--suave); font-weight: 600; font-size: 14px; cursor: pointer; }
.tipos input:checked + span { background: var(--texto); color: #15110c; border-color: var(--texto); }
.tipos input:focus-visible + span { outline: 2px solid var(--brasa); outline-offset: 2px; }
.animo { display: flex; gap: 8px; }
.animo button { flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--linea); background: var(--sup); color: var(--suave); font-weight: 700; }
.animo button[aria-pressed=true] { background: var(--brasa-fondo); border-color: var(--brasa); color: var(--brasa-2); }
.menu-flot { position: fixed; z-index: 70; min-width: 180px; padding: 6px; border-radius: 14px; background: var(--sup-2); border: 1px solid var(--linea-2); box-shadow: var(--sombra); display: grid; }
.menu-flot button { border: 0; background: transparent; text-align: left; padding: 11px 12px; border-radius: 9px; font-size: 14.5px; }
.menu-flot button:hover { background: var(--sup-3); }

/* Subida de rango */
.celebra { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(8, 6, 4, .9); text-align: center; padding: 24px; animation: aparece .3s; }
.celebra div { display: grid; gap: 14px; justify-items: center; }
.celebra .nombre { font-family: var(--serif); font-style: italic; font-size: clamp(56px, 16vw, 96px); line-height: 1; color: var(--brasa-2); animation: entra .6s cubic-bezier(.2, .8, .2, 1); }

/* Pago pendiente */
.muro { display: grid; gap: 20px; }
.muro .precio-linea { display: flex; justify-content: space-between; align-items: baseline; }
.muro .precio-linea b { font-size: 40px; font-weight: 500; letter-spacing: -.04em; }
.vacio { text-align: center; color: var(--tenue); padding: 30px 10px; font-size: 15px; }

@media (min-width: 900px) {
  .app-main { padding-top: 40px; }
}
