/* App del alumno (celular) */
body.alumno {
  min-height: 100dvh;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 18px),
    radial-gradient(ellipse at 0% 0%, rgba(227, 23, 28, .28), transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(227, 23, 28, .12), transparent 50%), var(--bg);
  background-attachment: fixed;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 640px; margin: 0 auto; min-height: 100dvh; }

/* Pantallas de acceso */
.a-auth { min-height: 100dvh; display: flex; flex-direction: column; padding: max(24px, env(safe-area-inset-top)) 20px 28px; gap: 18px; }
.a-auth .hero-logo { width: 120px; height: 120px; margin: 18px auto 4px; filter: drop-shadow(0 10px 30px rgba(227, 23, 28, .35)); }
.a-auth h1 { font-size: 46px; line-height: .95; text-align: center; }
.a-auth .lead { text-align: center; color: var(--text-2); margin: 0; font-size: 16px; }
.a-feats { display: grid; gap: 10px; margin: 6px 0; }
.a-feat { display: flex; gap: 12px; align-items: center; background: rgba(21, 21, 21, .8); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.a-feat .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--red-soft); color: var(--red-2); display: grid; place-items: center; flex: none; }
.a-feat b { display: block; font-size: 15px; }
.a-feat small { color: var(--text-2); }
.a-btns { display: grid; gap: 10px; margin-top: auto; }
.a-btn { width: 100%; padding: 16px; font-size: 17px; border-radius: 14px; }
.a-form { display: flex; flex-direction: column; gap: 14px; }
.a-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.a-form input, .a-form select { font-size: 16px !important; padding: 13px 14px !important; }
.a-back { align-self: flex-start; }
.a-legal { font-size: 13px; color: var(--text-2); line-height: 1.4; }
.a-legal input { margin-top: 2px; }
.a-ok { text-align: center; }

/* Shell */
.a-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: rgba(11, 11, 11, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.a-top .brand .wm { font-size: 22px; }
.a-top .brand img { width: 32px; height: 32px; }
.a-top .avatar { margin-left: auto; width: 34px; height: 34px; font-size: 13px; }
.a-main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.a-nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 640px; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(14, 14, 14, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
.a-nav button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; position: relative; cursor: pointer; }
.a-nav button svg.i { width: 22px; height: 22px; }
.a-nav button.on { color: var(--red-2); }
.a-nav .dot { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }

.a-h1 { font-size: 40px; line-height: 1; }
.a-sub { color: var(--text-2); margin: 4px 0 0; }
.a-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.a-card h3 { font-size: 24px; margin-bottom: 6px; }
.a-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: rgba(245, 181, 68, .1); border: 1px solid rgba(245, 181, 68, .35); color: #ffd28a; }
.a-banner b { color: #ffe2a8; }
.a-hoy { background: linear-gradient(160deg, rgba(227, 23, 28, .25), rgba(227, 23, 28, .04) 70%), var(--card); border-color: var(--red-line); }
.a-hoy .tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--red-2); margin-bottom: 6px; }
.a-hoy .row .k-btn { flex: 1; padding: 14px; font-size: 16px; }
.a-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.a-stat { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.a-stat small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.a-stat div { font-family: var(--display); font-size: 36px; line-height: 1.05; }
.a-msgprev { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.a-msgprev .grow { flex: 1; min-width: 0; }
.a-msgprev p { margin: 2px 0 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-list { display: flex; flex-direction: column; gap: 10px; }
.a-ex { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 8px; cursor: pointer; text-align: left; color: var(--text); font: inherit; width: 100%; }
.a-ex .th { width: 104px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; position: relative; flex: none; background: #000; }
.a-ex .th img, .a-ex .th video { width: 100%; height: 100%; object-fit: cover; display: block; }
.a-ex .th .media-ph svg { width: 22px; height: 22px; }
.a-ex .n { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.a-ex b { display: block; font-size: 15px; }
.a-ex .q-dose span { font-size: 12.5px; padding: 2px 8px; }
.a-days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.a-days button { white-space: nowrap; }

/* Chat */
.a-chat { display: flex; flex-direction: column; height: calc(100dvh - 64px - 96px - env(safe-area-inset-bottom)); }
.a-chat .chat { flex: 1; max-height: none; overflow-y: auto; padding: 4px 0 12px; }
.a-chat .composer textarea { font-size: 16px; }
.a-hist { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.a-hist:last-child { border-bottom: 0; }
.a-hist .grow { flex: 1; min-width: 0; }
.a-hist b { display: block; }

/* Entrenamiento guiado */
.w-screen { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; display: flex; flex-direction: column; }
.w-top { display: flex; align-items: center; gap: 10px; padding: max(12px, env(safe-area-inset-top)) 16px 10px; position: sticky; top: 0; background: rgba(11, 11, 11, .92); backdrop-filter: blur(8px); z-index: 2; }
.w-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-body { padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.w-body .ex-head h2 { font-size: 38px; }
.w-body .dose-row { grid-template-columns: repeat(2, 1fr); }
.w-body .dose-box div { font-size: 32px; }
.w-body .set-dot { width: 46px; height: 46px; }
.w-body .actions { display: grid; grid-template-columns: 1fr 1fr; }
.w-body .actions .k-btn { min-width: 0; padding: 16px; font-size: 16px; }
.w-body .actions .k-btn:first-child { grid-column: 1 / -1; }
.overlay .k-box { max-height: calc(100dvh - 40px); overflow-y: auto; }
.overlay .feel button { width: 72px; height: 86px; font-size: 32px; }
.a-detail { width: 100%; max-width: 600px; text-align: left; display: flex; flex-direction: column; gap: 12px; max-height: calc(100dvh - 40px); overflow-y: auto; }
.a-detail .dose-row { grid-template-columns: repeat(2, 1fr); }
.a-detail .ex-head h2 { font-size: 34px; }
