/* Diseño para celular: solo se aplica en pantallas de hasta 760 px. La versión de computadora no cambia. */
.solo-movil { display: none !important; }

@media (max-width: 760px) {
  .solo-movil { display: inline-flex !important; }
  .solo-movil[hidden] { display: none !important; }
  body { -webkit-text-size-adjust: 100%; }
  .kicker { letter-spacing: 0.2em; font-size: 0.68rem; }
  .btn { min-height: 48px; }

  /* ---------- Barra de navegación inferior (como una app) ---------- */
  /* Sin desenfoque en el encabezado: si no, la barra fija quedaría atrapada dentro de él */
  .top { height: 58px; padding: 0 18px; justify-content: flex-start; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: var(--navy-deep) !important; transform: none !important; filter: none !important; }
  .top img { height: 30px; }
  .top .who, .m-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; align-items: stretch; justify-content: space-around; gap: 0;
    height: calc(66px + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
    background: rgba(8, 10, 24, 0.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .top .who > .btn, .top .who > a.btn, .m-nav a, .m-nav button {
    flex: 1 1 0; min-width: 0; height: auto !important; min-height: 0; margin: 0; padding: 8px 2px 6px !important;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    border: 0 !important; border-radius: 0; background: none !important; box-shadow: none;
    color: var(--muted); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.1;
  }
  .top .who > .btn i, .m-nav i { font-size: 1.45rem; line-height: 1; }
  .top .who > .btn span, .m-nav span { display: block !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .top .who [hidden] { display: none !important; }
  .top .who .avatar, .top .who .hola { display: none !important; }
  .top .who > .btn-gold { color: var(--gold) !important; -webkit-text-fill-color: currentColor; }
  .top .who > .btn-gold::before, .top .who > .btn-gold::after { display: none; }
  .m-nav a[aria-current="page"], .top .who > .btn.on { color: var(--gold); }
  .m-nav a[aria-current="page"]::before {
    content: ""; position: absolute; top: 0; width: 28px; height: 2px; background: var(--gold);
  }
  .m-nav a { position: relative; }
  #panel span, [data-instalar] span { font-size: 0; }
  [data-instalar] span::after { content: "Instalar"; font-size: 0.6rem; }
  #panel span::after { content: "Panel"; font-size: 0.6rem; }

  /* Espacio para que la barra no tape el contenido */
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toast, .m-toast { bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
  .main { padding: 16px 16px 24px; }

  /* ---------- Inicio del aula ---------- */
  .inicio { gap: 18px; }
  .ini-hero { grid-template-columns: 1fr; padding: 26px 22px; gap: 0; }
  .ini-hero h1 { font-size: 2.3rem; line-height: 1; }
  .ini-hero p { font-size: 1rem; line-height: 1.55; }
  .ring-box { display: none; }
  .ini-actions { display: grid; gap: 12px; }
  .ini-actions .btn { width: 100%; }
  .ini-next { font-size: 0.88rem; line-height: 1.5; }

  /* Cifras: una tarjeta con filas claras (etiqueta a la izquierda, número a la derecha) */
  .ini-tiles { grid-template-columns: 1fr; gap: 0; border: 1px solid var(--line); border-radius: 4px; background: rgba(23, 27, 58, 0.62); }
  .ini-tiles > .tile { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; grid-column: auto !important; }
  .ini-tiles > .tile:first-child { border-top: 0; }
  .ini-tiles > .tile:hover { transform: none; }
  .ini-tiles .tile .kicker { font-size: 0.74rem; letter-spacing: 0.14em; color: var(--ivory); }
  .ini-tiles .tile b { margin: 0; font-size: 1.6rem; }
  .ini-tiles .tile p { display: none; }

  .ini-h2 { font-size: 1.15rem; margin-top: 10px; }
  .logros { gap: 10px; }

  /* ---------- Temario ---------- */
  .progress, .cert { padding-left: 18px; padding-right: 18px; }
  .mod > button { padding: 18px; grid-template-columns: 34px 1fr auto; }
  .mod > button strong { font-size: 0.95rem; line-height: 1.25; }
  .mod > button small { font-size: 0.78rem; }
  .mod li button { padding: 14px 18px 14px 20px; grid-template-columns: 34px 1fr 18px; font-size: 0.95rem; line-height: 1.4; color: var(--ivory); }
  .mod li button .mono { font-size: 0.8rem; color: var(--muted); }
  .mod li button.locked { opacity: 0.62; }
  .mod li button.locked .st::before { content: ""; }
  .note { font-size: 0.85rem; }

  /* ---------- Panel del maestro ---------- */
  .m-wrap { padding: 22px 16px 28px; }
  .m-head { gap: 16px; }
  .m-head h1 { font-size: 2rem; line-height: 1.02; }
  .m-head .btn { width: 100%; }
  .m-head-btns { width: 100%; }
  .m-link { text-align: center; }
  .kpis { grid-template-columns: 1fr 1fr !important; gap: 1px; background: var(--line); border: 1px solid var(--line); overflow: hidden; }
  .kpi { background: var(--navy-raised); border: 0 !important; padding: 18px 16px; display: flex; flex-direction: column; justify-content: space-between; min-height: 104px; }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi .kicker { font-size: 0.64rem; letter-spacing: 0.12em; line-height: 1.35; }
  .kpi b { font-size: 2rem; margin-top: 10px; }
  .m-card { padding: 20px 16px; }
  .m-card h2 { font-size: 1.1rem; }
  .p-stats .tile .kicker { letter-spacing: 0.12em; }
  .p-chips { flex-wrap: wrap; }
  .chip { white-space: normal; max-width: 100%; }
  .p-id, .p-id > * { min-width: 0; }

  /* Lista de alumnos */
  .al-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 16px 4px; }
  .al-name > span:last-child { min-width: 0; }
  .al-name strong { font-size: 1rem; white-space: normal; overflow: visible; line-height: 1.25; }
  .al-st .chip { font-size: 0.6rem; padding: 4px 8px; }

  /* Perfil del alumno */
  .p-hero { grid-template-columns: 58px minmax(0, 1fr); gap: 16px; align-items: start; padding: 22px 18px; }
  .p-av { width: 58px; font-size: 1.5rem; }
  .p-id h1 { font-size: 1.7rem; margin-top: 6px; }
  .p-quick, .p-quick .btn { width: 100%; }
  .p-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .p-stats .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 360px) {
  .top .who > .btn, .m-nav a, .m-nav button { font-size: 0.55rem; letter-spacing: 0.04em; }
  .kpi b { font-size: 1.7rem; }
  .ini-actions .btn { letter-spacing: 0.1em; font-size: 0.68rem; white-space: nowrap; }
}
