/* App del cliente: pensada para el móvil. */
body { background: #000; touch-action: pan-x pan-y; }
/* Vasos de agua de «Hoy» */
.vasos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.vaso { width: 30px; height: 40px; padding: 0; border: 0; background: transparent; cursor: pointer; display: grid; place-items: end center; }
.vaso i { display: block; width: 24px; height: 34px; border: 2px solid var(--muted); border-top-width: 3px; border-radius: 3px 3px 9px 9px; clip-path: polygon(0 0, 100% 0, 88% 100%, 12% 100%); background: linear-gradient(to top, var(--accent) 0%, var(--accent) var(--nivel, 0%), transparent var(--nivel, 0%)); transition: --nivel .2s, border-color .2s; }
.vaso.lleno i { --nivel: 72%; border-color: var(--accent); }
.vaso.extra i { border-style: dashed; }
.vaso:disabled { cursor: default; opacity: .7; }
.vaso.mas { color: var(--accent); font-size: 24px; font-weight: 600; place-items: center; }
/* iOS amplía la pantalla al tocar un campo con letra menor de 16px: así no se «ampliaa» la app. */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea { font-size: 16px; }
#app { max-width: 560px; min-height: 100dvh; margin: 0 auto; background: var(--bg); position: relative; }
#vista { padding: calc(14px + env(safe-area-inset-top)) 16px calc(92px + env(safe-area-inset-bottom)); }

.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.top .mc { width: 46px; }
.top h1 { font-size: 22px; }
.volver { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; color: var(--muted); font-weight: 500; }

.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 20; width: 100%; max-width: 560px; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(12, 14, 17, .94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabbar a { position: relative; display: grid; justify-items: center; gap: 3px; padding: 7px 2px; border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 500; }
.tabbar a svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--accent); }
.tabbar .badge { position: absolute; top: 2px; left: 54%; min-width: 17px; height: 17px; font-size: 11px; }

/* Tira de la semana */
.semana { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.semana button { display: grid; justify-items: center; gap: 2px; padding: 8px 0 7px; border-radius: 12px; border: 1px solid transparent; background: var(--surface); color: var(--muted); cursor: pointer; }
.semana button b { font-size: 16px; color: var(--text); font-weight: 600; }
.semana button span { font-size: 11px; letter-spacing: .06em; }
.semana button i { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.semana button.con i { background: var(--muted); }
.semana button.hecho i { background: var(--ok); }
.semana button.hoy { border-color: var(--line); }
.semana button.sel { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.semana button.sel b { color: var(--accent-ink); }
.semana button.sel i { background: var(--accent-ink); opacity: .55; }
.semana button.sel:not(.con) i { opacity: 0; }

/* Tareas del día */
.tarea { display: flex; align-items: center; gap: 12px; padding: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tarea + .tarea { margin-top: 10px; }
.tarea .ico { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--surface3); font-size: 20px; }
.tarea.entreno { border-color: rgba(43, 176, 211, .5); background: linear-gradient(135deg, rgba(43, 176, 211, .13), var(--surface) 60%); }
.tarea.entreno .ico { background: var(--accent); }
.tarea.hiit { border-color: rgba(31, 168, 77, .5); background: linear-gradient(135deg, rgba(31, 168, 77, .13), var(--surface) 60%); }
.hiit-run { --fase: var(--accent); text-align: center; padding: 22px 16px; border-radius: 22px; border: 2px solid var(--fase); background: linear-gradient(180deg, color-mix(in srgb, var(--fase) 22%, var(--surface)), var(--surface)); transition: border-color .3s, background .3s; }
.hiit-fase { font-size: 22px; font-weight: 800; color: var(--fase); margin-top: 6px; }
.hiit-tiempo { font-size: 96px; font-weight: 800; line-height: 1; margin: 6px 0; letter-spacing: -2px; }
.hiit-ej { font-size: 20px; font-weight: 700; min-height: 26px; }
.hiit-run .barra i { background: var(--fase); }
.tarea h3 { font-size: 15px; }
.tarea.hecha h3 { color: var(--muted); }
.marca { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #3a404a; background: transparent; cursor: pointer; display: grid; place-items: center; color: transparent; font-size: 15px; font-weight: 700; }
.marca.on { background: var(--ok); border-color: var(--ok); color: #03170e; }

.aviso { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid rgba(43, 176, 211, .35); margin-bottom: 14px; color: var(--text); }

/* Entreno */
.bloque { padding: 14px; }
.bloque + .bloque { margin-top: 12px; }
.ej { display: flex; gap: 12px; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.ej .thumb { position: relative; flex: none; width: 64px; height: 64px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); overflow: hidden; padding: 0; cursor: pointer; display: grid; place-items: center; color: var(--muted); font-size: 22px; }
.ej .thumb img, .ej .thumb video { width: 100%; height: 100%; object-fit: cover; }
.ej .nota { margin-top: 6px; padding: 7px 10px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; font-size: 13px; font-weight: 500; }
.series { display: grid; gap: 6px; margin-top: 10px; }
.serie { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.25fr); gap: 6px; align-items: center; }
.serie span { font-size: 12px; color: var(--muted); text-align: center; }
.serie input { min-height: 38px; min-width: 0; padding: 6px 6px; text-align: center; }
.ej > .grow { min-width: 0; }
.crono { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 25; width: calc(100% - 28px); max-width: 532px; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .55); font-weight: 600; }
.crono b { font-size: 26px; font-variant-numeric: tabular-nums; min-width: 74px; }
.crono .btn { background: rgba(0, 0, 0, .16); border-color: transparent; color: var(--accent-ink); }

/* Nutrición */
.macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.macros div { padding: 10px 4px; border-radius: 12px; background: var(--surface2); }
.macros b { display: block; font-size: 18px; }
.macros span { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.alimento { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.alimento:first-of-type { border-top: 0; }

/* Revisión */
.fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.foto { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; border: 1.5px dashed #3a404a; background: var(--surface2); overflow: hidden; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.foto .pie-foto { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; }
.escala { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.escala button { min-height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); cursor: pointer; font-weight: 500; }
.escala button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Chat */
.chat { display: flex; flex-direction: column; height: calc(100dvh - 72px - env(safe-area-inset-bottom)); margin: calc(-14px - env(safe-area-inset-top)) -16px 0; }
.chat .cab { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat .msgs { flex: 1; overflow-y: auto; padding: 14px 16px; }
.chat form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.chat textarea { min-height: 42px; max-height: 120px; border-radius: 20px; resize: none; }

.video-card { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; width: 100%; text-align: left; }
.video-card + .video-card { margin-top: 10px; }
.video-card .play { flex: none; width: 54px; height: 54px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 20px; overflow: hidden; }
.video-card .play img { width: 100%; height: 100%; object-fit: cover; }
.ej .thumb::after { content: '▶'; position: absolute; right: 3px; bottom: 3px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: 9px; display: grid; place-items: center; }
.ej .thumb:not(:has(img)):not(:has(video))::after { display: none; }

/* MC Go: botones de elección */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }


/* Barras de pasos (perfil del cliente y ficha en el panel) */
.barras-act { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; }
.barras-act div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; min-width: 0; }
.barras-act i { display: block; width: 100%; max-width: 18px; border-radius: 4px 4px 0 0; background: var(--accent); opacity: .85; }
.barras-act i.con { background: var(--ok); }
.barras-act span { font-size: 10px; color: var(--muted); }
