/* Menú inferior de la app en el móvil (MobileAppNav.tsx) y hoja «Más».
   Solo existe por debajo de 768px; en el ordenador manda la barra lateral. */
.mnav { display: none; }
.mmore-backdrop, .mprep-hint { display: none; }

@media (max-width: 767px) {
  .mnav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    display: flex;
    align-items: stretch;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--line, #e5e7eb);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .mnav-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    padding: 0 2px;
    font-family: var(--font-body, inherit);
    color: var(--fg-muted, #6b7280);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mnav-btn span {
    font-size: 10.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .mnav-btn.active { color: var(--accent, #0057ff); }
  .mnav-btn.active span { font-weight: 800; }
  .mnav-btn:active { opacity: 0.7; }

  /* Versión oscura dentro del modo «En clase» */
  .mnav.mnav--dark {
    position: absolute;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    background: rgba(15, 18, 26, 0.97);
    border-top-color: rgba(255, 255, 255, 0.08);
  }
  .mnav--dark .mnav-btn { color: rgba(255, 255, 255, 0.45); }
  .mnav--dark .mnav-btn.active { color: var(--mob-accent, #d4ff3f); }

  /* Modo «En clase»: el contenido deja sitio al menú (incluida la zona del gesto de inicio del iPhone) */
  .mob-app:has(.mnav--dark) .mob-lobby,
  .mob-app:has(.mnav--dark) .mob-run,
  .mob-app:has(.mnav--dark) .mob-finish,
  .mob-app:has(.mnav--dark) .mob-tools {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  /* Dejar sitio al menú en las vistas con menú claro */
  .view-today .today-view,
  .view-library .lib-view {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Aviso al preparar una sesión desde «Mis clases» */
  .mprep-hint {
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    z-index: 61;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #0a3d1f;
    color: #fff;
    font-size: 13.5px;
    line-height: 1.4;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.45);
  }
  .mprep-hint span { flex: 1; }
  .mprep-hint button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 30px; height: 30px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
  }

  /* Hoja «Más» */
  .mmore-backdrop {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(8, 15, 40, 0.45);
    align-items: flex-end;
  }
  .mmore-sheet {
    width: 100%;
    max-height: 88dvh;
    overflow-y: auto;
    background: var(--bg-panel, #fff);
    color: var(--fg, #0f172a);
    border-radius: 22px 22px 0 0;
    padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    font-family: var(--font-body, inherit);
    animation: mmore-up 0.22s ease-out;
  }
  @keyframes mmore-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .mmore-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong, #cbd5e1); margin: 4px auto 14px; }
  .mmore-account, .mmore-guest {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: var(--bg-hover, #f3f5f9);
    margin-bottom: 10px;
  }
  .mmore-guest { flex-direction: column; align-items: stretch; gap: 4px; }
  .mmore-avatar {
    width: 42px; height: 42px; flex-shrink: 0;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent, #0057ff); color: #fff;
    font-weight: 800; font-size: 18px;
  }
  .mmore-account-text { flex: 1; min-width: 0; }
  .mmore-name { font-weight: 800; font-size: 15px; }
  .mmore-email { font-size: 13px; color: var(--fg-muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mmore-guest .mmore-email { white-space: normal; }
  .mmore-plan { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px; background: #d4ff3f; color: #0a3d1f; }
  .mmore-plan--trial { background: #e8efff; color: #0040c0; }
  .mmore-guest-actions { display: flex; gap: 8px; margin-top: 10px; }
  .mmore-primary, .mmore-secondary {
    flex: 1; min-height: 44px; border-radius: 12px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit;
  }
  .mmore-primary { background: var(--accent, #0057ff); color: #fff; border: none; }
  .mmore-secondary { background: transparent; color: var(--fg, #0f172a); border: 1px solid var(--line-strong, #cbd5e1); }
  .mmore-list { display: flex; flex-direction: column; }
  .mmore-item {
    display: flex; align-items: center; gap: 14px;
    min-height: 52px; padding: 0 6px;
    background: none; border: none; border-bottom: 1px solid var(--line, #eef0f4);
    color: inherit; text-decoration: none; font-size: 15px; font-weight: 600; font-family: inherit;
    text-align: left; cursor: pointer;
  }
  .mmore-item svg { color: var(--fg-muted, #6b7280); flex-shrink: 0; }
  .mmore-item--danger { color: #d33; }
  .mmore-item--danger svg { color: #d33; }
  .mmore-close {
    width: 100%; margin-top: 14px; min-height: 48px; border-radius: 12px;
    border: none; background: var(--bg-hover, #f3f5f9); color: inherit; font-weight: 700; font-size: 15px; font-family: inherit; cursor: pointer;
  }
}
